Re: Strings

NOTE: The netcdf-hdf mailing list is no longer active. The list archives are made available for historical reasons.

Hi Ed,

You should be able to use strlen function on each element of your array to get a length of each string.

Elena

At 01:11 PM 9/8/2005, Ed Hartnett wrote:

HDF Folk:

If I have a attribute which is a 1D array of string, how, in general,
do I find out the length of each string in the array, so that I can
allocate space for it?

If I use H5Sget_simple_extent_ndims then I get the number of strings
in the array, but how do I get the length of each string?

Also, if I read it into a buffer, is each string null-terminated? Is
there some usual way to store an array of strings in C for HDF5 users?

Thanks!

Ed
--
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx

-----------------------------------------------------------------------------------------------
Elena Pourmal, HDF QA, Maintenance and Support Team Leader
NCSA University of Illinois at Urbana-Champaign
605 E. Springfield Ave.
Champaign, IL 61820

epourmal@xxxxxxxxxxxxx
(217)333-0238 (office)
(217)244-1987 (fax)
----------------------------------------------------------------------------------------------



  • 2005 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-hdf archives: