Previous: Enum CDL Example Next: Opaque Example Table of contents Frames 2011 Unidata NetCDF Workshop > Using Groups and NetCDF-4 Types

16.15 Using the Opaque Type
The opaque type holds arrays of unknown contents, with known size.

 

The following example, from libsrc4/tst_opaques.c, creates a very simple opaque type.

      /* Create a file that has an opaque attribute. */
      if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
      if (nc_def_opaque(ncid, BASE_SIZE, TYPE_NAME, &xtype)) ERR;

      /* Write an att. */
      if (nc_put_att(ncid, NC_GLOBAL, ATT_NAME, xtype, DIM_LEN, data)) ERR;
      if (nc_close(ncid)) ERR;

 


Previous: Enum CDL Example Next: Opaque Example Table of contents Frames 2011 Unidata NetCDF Workshop > Using Groups and NetCDF-4 Types