home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:20222 comp.lang.fortran:5188
- Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!uni-heidelberg!rz.uni-karlsruhe.de!fg30.rz.uni-karlsruhe.de!ig25
- From: ig25@fg30.rz.uni-karlsruhe.de (Thomas Koenig)
- Newsgroups: comp.lang.c,comp.lang.fortran
- Subject: Re: calling a Fortran subroutine from a C program
- Date: 26 Jan 93 15:12:09 GMT
- Organization: University of Karlsruhe, Germany
- Lines: 30
- Distribution: na
- Message-ID: <ig25.728061129@fg30>
- References: <1993Jan22.190624.23084@chpc.utexas.edu> <1993Jan22.200839.8352@sol.ctr.columbia.edu> <1993Jan22.233618.17814@chpc.utexas.edu> <1993Jan23.152153.7178@biome.bio.ns.ca>
- NNTP-Posting-Host: fg30.rz.uni-karlsruhe.de
-
- silvert@biome.bio.ns.ca (Bill Silvert) writes:
-
- >In <1993Jan22.233618.17814@chpc.utexas.edu> michael@chpc.utexas.edu (Michael Lemke) writes:
-
- >>Not quite. To make it really clear: The difference is
- >> CHARACTER*100 STRING
- >>or
- >> CHARACTER*1 STRING(100)
- >>which are very different data structures. The latter is an array, the
- >>first is a single variable. I don't care how C chews its memory, it can
- >>hardly distinguish these two cases. The last is pretty close in
- >>functionality to C's concept (except for having a length stored
- >>somewhere) as you'd need something like strcpy to copy data.
-
- >It seems to me that there would be absolutely no difference in memory
- >allocation between these two cases, and that they would appear identically
- >to a C program. Thus in terms of passing them to a C program I can't
- >see what the difference would be. The only difference is how the Fortran
- >code refers to them.
-
- An implementation might very well choose to start every character
- variable on a word boundary, for speed reasons.
-
- CHARACTER*1 STRING(100)
-
- would then appear to C to be an array of ints, instead of chars.
- --
- Thomas Koenig, ig25@rz.uni-karlsruhe.de, ig25@dkauni2.bitnet
- Institut fuer Mechanische Verfahrenstechnik und Mechanik,
- Bereich Angewandte Mechanik, Tel: 3758
-