NetCDF  4.3.2
Accessing Attributes with put_attr() and get_attr()
     int (*get_att)(int ncid, int varid, const char *name,
                         void *value, nc_type memtype);
     int (*put_att)(int ncid, int varid, const char *name, nc_type datatype, size_t len,
                    const void *value, nc_type memtype);

Again, the key difference is the memtype parameter. As with put/get_vara, it used NC_INT64 to encode the long case.

 All Data Structures Files Functions Variables Typedefs Defines