What Should I MarshalAs for Character Type in Fortran?
问题 I am calling a fortran subroutine from C#. One of the parameter I have to pass in is character .i.e, in fortran that parameter is declared as character, intent(in) :: bmat*1 The issue now is, in C# code, what should I marshaled it as? I know that for integer , I should marshal it as [MarshalAs(UnmanagedType.I4)] , but what about character ? Edit: This is my fortran code: subroutine chartest(bmat) !DEC$ ATTRIBUTES DLLEXPORT::chartest !DEC$ ATTRIBUTES ALIAS:'chartest'::chartest !DEC$ ATTRIBUTES