home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:20100 comp.lang.fortran:5141
- Newsgroups: comp.lang.c,comp.lang.fortran
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!phoenix!bobp
- From: bobp@msi.com (Bob Pitha)
- Subject: Re: calling a Fortran subroutine from a C program
- Followup-To: comp.lang.c,comp.lang.fortran
- References: <1993Jan22.233618.17814@chpc.utexas.edu>
- Sender: nobody@ctr.columbia.edu
- Organization: Molecular Simulations, Inc.
- Date: Sat, 23 Jan 1993 02:58:35 GMT
- X-Newsreader: TIN [version 1.1 PL8]
- Message-ID: <1993Jan23.025835.16538@sol.ctr.columbia.edu>
- X-Posted-From: phoenix.msi.com
- NNTP-Posting-Host: sol.ctr.columbia.edu
- Lines: 32
-
- Michael Lemke (michael@chpc.utexas.edu) wrote:
- : 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.
-
- Of course they're different in FOrtran; you could hardly do the
- following:
- character*1 string (100)
-
- string = "blahblahblah"
-
- But that wasn't my point. My point was, I was talking about passing
- an *array or characters* from C. Rather than write "array or characters"
- I wrote "character array"; but I was not talking about a Fortran array
- of strings. I read the question origianlly in comp.lang.c, and in c
- the ambiguity does not exist. I'm sorry if I confused you. I think
- we both know what I meant and what you mean, so let's just leave it.
-
- -----------------------------------------------------------------------
- Bob Pitha Molecular Simulations Inc.
- bobp@msi.com 16 New England Executive Park
- (617) 229-9800 x242 Burlington, MA 01803-5297
-