Previous: Example Creating an Array of Strings Next: Additional Numeric Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > Using Groups and the New NetCDF-4 Atomic Types

15.9 Example Reading an Array of Strings
This code reads the example string attribute.
      /* Check it out. */
      if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
      if (nc_get_att(ncid, NC_GLOBAL, ATT_NAME, data_in)) ERR; 
      for (i = 0; i < att_len; i++)
	 if (strcmp(data_in[i], data[i])) ERR;
      if (nc_free_string(att_len, (char **)data_in)) ERR;
      if (nc_close(ncid)) ERR;

 


Previous: Example Creating an Array of Strings Next: Additional Numeric Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > Using Groups and the New NetCDF-4 Atomic Types