I am reading hdf5 file which has String dataset values with fixed length
size and the number of dimensions is 1. I am using HDF 1.10.1 Windows10
x64.
I allocate array of pointers to read the data values in the same way as
given in the hdf5 documentation. Here is the code which is reading the
string dataset values.
In this code, the dynamic 2D array of pointers is not initialized as per
the standard way using a loop.
unique_ptr<T*[]> apbuffer = make_unique<T*[]>(size_of_dimensions[0]);
T** buffer = dpbuffer.get();
unique_ptr<T[]> apbuffer1 = make_unique<T[]>(size_of_dimensions[0] *
size);
buffer[0] = dpbuffer1.get();
for (int i = 1; i < size_of_dimensions[0]; i++) {
buffer[i] = buffer[0] + i * size_of_dimensions[1];
}
H5Dread(dataset_id, dataset_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT,
&buffer[0][0]);
I would like to know, what are other possible ways to allocate the buffer
to read 1 dimension string dataset values?
Can we simply read the 1 dimension dataset values by passing arrays
pointed to the buffer?
Any insight is greatly appreciated.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5