How should multiple Fortran strings be passed to C?
问题 To pass a Fortran string to C, a hidden parameter is also passed with the variable's size. Here's a working fortran definition, and the C (actually C++/CLI) method: interface subroutine AppendExtension( + Filename) + bind(C, name="AppendExtension") character *1, intent(inout):: Filename end subroutine AppendExtension end interface and here's the C++/CLI that gets called: extern "C" { void __declspec(dllexport) __cdecl AppendExtension( char * name, int buffersize) { String^ clistr = gcnew