This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C/Fortran integration and string passing


Hi Pat,

Have you tried:

struct PStr
{
    unsigned char len;  // 0 ... 255
    char text[256];
};

Note, the PStr.text doesn't NEED to be '\0', but I left room for you to plop
down a '\0' at the end.

You'll have to make sure you set the PStr.len appropriately before calling
the FORTRAN routines.

Or write C++ mutators that keep everything kosher.  (Assuming you are using
C++.)

DISCLAIMER:  I'm not 100% that this is correct.  It's just a guess.

--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]