home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20222 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  2.0 KB

  1. Xref: sparky comp.lang.c:20222 comp.lang.fortran:5188
  2. 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
  3. From: ig25@fg30.rz.uni-karlsruhe.de (Thomas Koenig)
  4. Newsgroups: comp.lang.c,comp.lang.fortran
  5. Subject: Re: calling a Fortran subroutine from a C program
  6. Date: 26 Jan 93 15:12:09 GMT
  7. Organization: University of Karlsruhe, Germany
  8. Lines: 30
  9. Distribution: na
  10. Message-ID: <ig25.728061129@fg30>
  11. 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>
  12. NNTP-Posting-Host: fg30.rz.uni-karlsruhe.de
  13.  
  14. silvert@biome.bio.ns.ca (Bill Silvert) writes:
  15.  
  16. >In <1993Jan22.233618.17814@chpc.utexas.edu> michael@chpc.utexas.edu (Michael Lemke) writes:
  17.  
  18. >>Not quite.  To make it really clear:  The difference is
  19. >>    CHARACTER*100 STRING
  20. >>or
  21. >>    CHARACTER*1 STRING(100)
  22. >>which are very different data structures.   The latter is an array, the
  23. >>first is a single variable.  I don't care how C chews its memory, it can
  24. >>hardly distinguish these two cases.  The last is pretty close in
  25. >>functionality to C's concept (except for having a length stored
  26. >>somewhere) as you'd need something like strcpy to copy data.
  27.  
  28. >It seems to me that there would be absolutely no difference in memory
  29. >allocation between these two cases, and that they would appear identically
  30. >to a C program.  Thus in terms of passing them to a C program I can't
  31. >see what the difference would be.  The only difference is how the Fortran
  32. >code refers to them.
  33.  
  34. An implementation might very well choose to start every character
  35. variable on a word boundary, for speed reasons.
  36.  
  37.       CHARACTER*1 STRING(100)
  38.  
  39. would then appear to C to be an array of ints, instead of chars.
  40. -- 
  41. Thomas Koenig, ig25@rz.uni-karlsruhe.de, ig25@dkauni2.bitnet
  42. Institut fuer Mechanische Verfahrenstechnik und Mechanik,
  43. Bereich Angewandte Mechanik, Tel: 3758
  44.