Previous: nc_inq_grp_parent, Up: Groups
Create a group. Its location id is returned in the new_ncid pointer.
int nc_def_grp(int parent_ncid, char *name, int *new_ncid);
parent_ncidnamenew_ncidNC_NOERRNC_EBADIDNC_ENAMEINUSENC_EMAXNAMENC_EBADNAMENC_ENOTNC4NC_ESTRICTNC3NC_EHDFERRNC_EPERMNC_ENOTINDEFINE int root_ncid, a1_ncid;
char grpname[] = "assimilation1";
/* Get the ncid of the root group. */
if ((res = nc_inq_ncid(root_ncid, NULL, &root_ncid)))
return res;
/* Create a group. */
if ((res = nc_def_grp(root_ncid, grpname, &a1_ncid)))
return res;