Consider the case where you know the names of not only the netCDF datasets, but also the names of their dimensions, variables, and attributes. The order of typical C calls to read data from those variables in a netCDF dataset is (with arguments and error handling not shown):
nc_open /* open existing netCDF dataset */ ... nc_inq_dimid /* get dimension IDs */ ... nc_inq_varid /* get variable IDs */ ... nc_get_att /* get attribute values */ ... nc_get_var /* get values of variables */ ... nc_close /* close netCDF dataset */