C++源代码如下:
[C++] 纯文本查看 复制代码 #include <stdio.h>
#include <windows.h>
#include <iostream>
#include <msclr\marshal_cppstd.h>
#include "float.h"
#include <string>
#include <math.h>
#include <cstring>
#include <vector>
#include <istream>
#include <fstream>
using namespace msclr::interop;
using namespace std;
extern "C" {
void __stdcall GETSTRING( char *A,
int LEN);
}
void main()
{
char STR[]="hello";
GETSTRING(STR,strlen(STR));
return;
}
fortran代码如下:
[Fortran] 纯文本查看 复制代码 subroutine getstring(a)
!DEC$ IF DEFINED (_DLL)
!DEC$ ATTRIBUTES DLLEXPORT ::GETSTRING
!DEC$ END IF
implicit none
character(len=*)::a
write(*,*)a
return
end subroutine
fortran编译器为Intel Parallel Studio XE 2013, C++编译器为VS2012 |