Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!princeton!allegra!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c Subject: Re: Fortran vs. C strings Message-ID: <7040@alice.UUCP> Date: Wed, 1-Jul-87 08:43:50 EDT Article-I.D.: alice.7040 Posted: Wed Jul 1 08:43:50 1987 Date-Received: Fri, 3-Jul-87 00:41:27 EDT References: <6480@dartvax.UUCP> <1202@ius2.cs.cmu.edu> <223@sugar.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 22 In article <223@sugar.UUCP>, peter@sugar.UUCP writes: > 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. It is difficult and unnecessary for a Fortran 77 compiler that conforms to the ANSI standard to store a length with a character string. It is unnecessary because the length of every string is known to the compiler as a constant, except for parameters. Parameters must be handled specially anyway, because they can be temporaries. It is difficult because the language defines the meaning of things like: CHARACTER A*10, B*10, C*20 COMMON A, B EQUIVALENCE (A, C) so that the first 10 characters of C are equivalent to the 10 characters of A and the next 10 characters of C are equivalent to the 10 characters of B. It's hard to do this and still store a count.