Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!im4u!woton!riddle From: riddle@woton.UUCP Newsgroups: comp.lang.c Subject: Re: Fortran vs. C strings Message-ID: <740@woton.UUCP> Date: Thu, 18-Jun-87 12:50:30 EDT Article-I.D.: woton.740 Posted: Thu Jun 18 12:50:30 1987 Date-Received: Sat, 20-Jun-87 01:27:55 EDT References: <6480@dartvax.UUCP> <1202@ius2.cs.cmu.edu> Organization: Shriners Burns Institute, Galveston Lines: 18 Summary: This is compiler-dependent. Final-Delimiter: "Bob" In article <1202@ius2.cs.cmu.edu>, edw@ius2.cs.cmu.edu (Eddie Wyatt) writes: > > Fortrash strings (I think) have the format first four(?) bytes > holds the size of the string followed by the characters in the string. This is compiler-dependent. As I recall, Microsoft Fortran (to name one example) has two types of character constants, one for use within Fortran and one for use when interfacing with C. The former has no accessible length information or final delimiter stored with it at all, at least not that I could find; the latter uses a C-style final null as a delimiter. When you program in Microsoft Fortran, you indicate that you want a C-style string by appending a C to it after the final quote (e.g. 'foobar'C). This is an awkward solution to the problem, but it works. Other compilers may not provide any solution at all. --- Prentiss Riddle ("Aprendiz de todo, maestro de nada.") --- Opinions expressed are not necessarily those of Shriners Burns Institute. --- riddle@woton.UUCP {ihnp4,harvard,seismo}!ut-sally!im4u!woton!riddle