Hello everybody I am new using HDF5 and I have a problem using dynamic
memory array  reading a data set.

When I read my data set using static arrays (like in the all examples in
documentation ) all it is right

data_out[n][m][l];
dataSet.read(data_out, PredType::NATIVE_DOUBLE,dataSpace);

the  array dada_out have all numbers in the data set well.

However if I define  data_out using dynamic memory, i.e.

  double *** data_out;
....

data_out = new double**[n];
for(int i=0; i < n; ++i)
  data_out[i] = new double *[m];

for(int i=0; i < n; ++i)
  for(int j=0; j < m; ++j)
    data_out[i][j] = new double [l];


dataSet.read(data_out[0][0], PredType::NATIVE_DOUBLE,dataSpace);

only the first row (data_out[0][0][1..l]) have the correct numbers, and the
another elements are in a wrong order or they are 0.

Anyone  know what is the problem ?
Anyone have a simple example using a dynamic memory arrays ?

Best regards.
Daniel.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to