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

  1. Xref: sparky comp.lang.c:20100 comp.lang.fortran:5141
  2. Newsgroups: comp.lang.c,comp.lang.fortran
  3. Path: sparky!uunet!caen!sol.ctr.columbia.edu!phoenix!bobp
  4. From: bobp@msi.com (Bob Pitha)
  5. Subject: Re: calling a Fortran subroutine from a C program
  6. Followup-To: comp.lang.c,comp.lang.fortran
  7. References: <1993Jan22.233618.17814@chpc.utexas.edu>
  8. Sender: nobody@ctr.columbia.edu
  9. Organization: Molecular Simulations, Inc.
  10. Date: Sat, 23 Jan 1993 02:58:35 GMT
  11. X-Newsreader: TIN [version 1.1 PL8]
  12. Message-ID: <1993Jan23.025835.16538@sol.ctr.columbia.edu>
  13. X-Posted-From: phoenix.msi.com
  14. NNTP-Posting-Host: sol.ctr.columbia.edu
  15. Lines: 32
  16.  
  17. Michael Lemke (michael@chpc.utexas.edu) wrote:
  18. : To make it really clear:  The difference is
  19.  
  20. :     CHARACTER*100 STRING
  21.  
  22. : or
  23.  
  24. :     CHARACTER*1 STRING(100)
  25.  
  26. : which are very different data structures.   The latter is an array, the
  27. : first is a single variable.  I don't care how C chews its memory, it can
  28. : hardly distinguish these two cases.  The last is pretty close in
  29. : functionality to C's concept (except for having a length stored
  30. : somewhere) as you'd need something like strcpy to copy data.
  31.  
  32.   Of course they're different in FOrtran; you could hardly do the
  33. following:
  34.       character*1 string (100)
  35.  
  36.       string = "blahblahblah"
  37.  
  38.   But that wasn't my point.  My point was, I was talking about passing
  39. an *array or characters* from C.  Rather than write "array or characters"
  40. I wrote "character array"; but I was not talking about a Fortran array
  41. of strings.  I read the question origianlly in comp.lang.c, and in c
  42. the ambiguity does not exist.  I'm sorry if I confused you.  I think
  43. we both know what I meant and what you mean, so let's just leave it.
  44.  
  45. -----------------------------------------------------------------------
  46. Bob Pitha                      Molecular Simulations Inc.
  47. bobp@msi.com                   16 New England Executive Park
  48. (617) 229-9800 x242            Burlington, MA 01803-5297
  49.