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


5.16 Get the FieldID of a Compound Type Field: nc_inq_compound_fieldindex

Given the typeid and the name, get the fieldid.

Usage

     int nc_inq_compound_fieldindex(nc_type typeid, const char *name, int *fieldidp);
typeid
The typeid for this compound type, as returned by nc_def_compound, or nc_inq_var.
name
The name of the field.
fieldidp
A pointer to an int which will get the field id of the named field.

Errors

NC_NOERR
No error.
NC_EBADTYPEID
Bad type id.
NC_EUNKNAME
Can't find field of this name.
NC_EHDFERR
An error was reported by the HDF5 layer.

Example

See the example section for nc_inq_compound.