# H5Dread get data incompletely

**URL:** <https://forum.hdfgroup.org/t/h5dread-get-data-incompletely/9205>\
**Category:** Hdf-forum archives\
**Created:** [November 27, 2021, 3:52pm UTC](https://forum.hdfgroup.org/t/h5dread-get-data-incompletely/9205 "2021-11-27T15:52:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lei.zheng](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/l/ac91a4/32.png) [@lei.zheng](https://forum.hdfgroup.org/u/lei.zheng)\
**Post date:** [November 27, 2021, 3:52pm UTC](https://forum.hdfgroup.org/t/h5dread-get-data-incompletely/9205/1 "2021-11-27T15:52:58Z")

</div>

I want to read h5 file in C. Here is my code to read a compound dataset. I have 7 members in structure “Boundary”, which are floats or integers. However i can’t get the last member from H5Dread. The other 6 members have been read properly. I’ve checked with h5dump.exe, the h5 file is fine.  
Have i done something wrong in my code?  
´´´  
Boundary \*\*boundaries;  
hid\_t dset = H5Dopen(group, “Boundaries”, H5P\_DEFAULT);  
hid\_t space = H5Dget\_space(dset);  
H5Sget\_simple\_extent\_dims(space, dims, NULL);  
hid\_t type = H5Dget\_type(dset);  
hid\_t memtype = H5Tcreate(H5T\_COMPOUND, sizeof(Boundary));  
int nmenber = H5Tget\_nmembers(type);  
for (int i = 0; i \< nmenber; i++) {  
const char \*name = H5Tget\_member\_name(type, i);  
size\_t offset = H5Tget\_member\_offset(type, i);  
hid\_t membertype = H5Tget\_member\_type(type, i);  
status = H5Tinsert(memtype, name, offset, membertype);  
}  
\*boundaries = (Boundary \*)malloc(dims[0] \* sizeof(Boundary));  
status = H5Dread(dset, memtype, H5S\_ALL, H5S\_ALL, H5P\_DEFAULT, \*boundaries);

´´´
