Previous: Enum Example Next: Variable-Length Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4

16.10 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 Example Next: Variable-Length Types Table of contents Frames User guide
2008 Unidata NetCDF Workshop for Developers and Data Providers > User Defined Types in NetCDF-4