This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
David, >Date: Tue, 23 Jan 2001 15:28:54 -0700 (MST) >From: Robert Pincus <address@hidden> >Organization: ? >To: "Bennett, David A" <address@hidden> >Subject: RE: 20010123: nc-3.5 Fortran 90: nf90_get_var() on 2D character v >ariable >Keywords: 200101162001.f0GK1ue07435 The above message contained the following: > I don't remember how the C interface differs from the Fortran 90 interface > well enough off the top of my head to know if strings are treated > differently. If the C interface uses null characters to delineate the end > of strings, though, you're in trouble. In the C API, strings are treated as fixed-length character arrys with no trailing NUL (0) character. In fact, the C API really doesn't have the concept of "strings" at all -- just arrays of character values. If the data is written with a trailing NUL, then the read-in array will contain the NUL (assuming a sufficient number of characters was read); otherwise, it won't. Regards, Steve Emmerson <http://www.unidata.ucar.edu>