This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C/Fortran integration and string passing
- From: John Love-Jensen <eljay at adobe dot com>
- To: Pat Gunn <pgunn at dachte dot org>, <gcc-help at gcc dot gnu dot org>
- Date: Thu, 17 Oct 2002 11:48:47 -0500
- Subject: 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