Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!hoptoad!academ!uhnix1!nuchat!sugar!peter From: peter@sugar.UUCP (Peter DaSilva) Newsgroups: comp.lang.c Subject: Re: Fortran vs. C strings Message-ID: <223@sugar.UUCP> Date: Thu, 25-Jun-87 20:48:26 EDT Article-I.D.: sugar.223 Posted: Thu Jun 25 20:48:26 1987 Date-Received: Sat, 4-Jul-87 22:28:02 EDT References: <6480@dartvax.UUCP> <1202@ius2.cs.cmu.edu> Organization: Sugar Land UNIX - Houston, TX Lines: 27 Summary: Fortran strings > Fortrash strings (I think) have the format first four(?) bytes > holds the size of the string followed by the characters in the string. That is implementation dependent. They may also do such things as store a byte length at the address, or even store a value *before* the address passed. They may not even have a length you can use at all, if it's an old Fortran. I would suggest you do this: char foo[80]; main() { int i; fortest(); for(i = 0; i < 80; i++) printf("%03o", foo[i]); } SUBROUTINE FORTEST CHARACTER*80 BAR COMMON /FOO/ BAR BAR = 'TEST STRING' END Then get your ascii table and examine the output.