Next: , Previous: nc_inq_user_type, Up: User Defined Data Types


5.5 Compound Types Introduction

NetCDF-4 added support for compound types, which allow users to construct a new type - a combination of other types, like a C struct.

Compound types are not supported in classic or 64-bit offset format files.

To write data in a compound type, first use nc_def_compound to create the type, multiple calls to nc_insert_compound to add to the compound type, and then write data with the appropriate nc_put_var1, nc_put_vara, nc_put_vars, or nc_put_varm call.

To read data written in a compound type, you must know its structure. Use the nc_inq_compound functions to learn about the compound type.