当前位置: 技术问答>linux和unix
在LINUX操作系统下,在C/C++与FORTRAN两种编程语言之间相互调用问题?
来源: 互联网 发布时间:2016-07-10
本文导语: 请问,在LINUX操作系统下,在C/C++与FORTRAN两种编程语言之间相互调用问题?请写个格式样子! | Calling Fortran routines from C++ Example-1: Calling routines and functions The following sample shows how Fortr...
请问,在LINUX操作系统下,在C/C++与FORTRAN两种编程语言之间相互调用问题?请写个格式样子!
|
Calling Fortran routines from C++
Example-1: Calling routines and functions
The following sample shows how Fortran routines and functions can be called from a C++ program.
(1) The C++ file:
// This illustrates how a Fortran routine and function may be
// called from a main program in C++
#include
extern "C"
{
void __stdcall FR1(int*,int *);
int __stdcall FF1(int *);
}
int main()
{
int n=10,nSq,nCube;
FR1(&n,&nSq);
cout
Example-1: Calling routines and functions
The following sample shows how Fortran routines and functions can be called from a C++ program.
(1) The C++ file:
// This illustrates how a Fortran routine and function may be
// called from a main program in C++
#include
extern "C"
{
void __stdcall FR1(int*,int *);
int __stdcall FF1(int *);
}
int main()
{
int n=10,nSq,nCube;
FR1(&n,&nSq);
cout