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


John Love-Jensen wrote:

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.

DISCLAIMER:  I'm not 100% that this is correct.  It's just a guess.
Well, you do not have to guess, because g77's behaviour is documented (what a concept !)

See http://gcc.gnu.org/onlinedocs/gcc-3.2/g77/

-> Other languages -> Tools and advice for interoperating with C and C++

Success !

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


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