I read in datasets from an H5 file in Microsoft Visual C ++ 2008. Everything works fine for data like int and double, but I run into problems when I run into strings. In the H5 file, I have 18 lines of each fixed length of 24. My code is as follows:
StrType strdatatype(PredType::C_S1, 24); char *buffer1[18]; DataSet datasetCurveNames = riskFactorsH5.openDataSet("/gstrCurveNames"); datasetCurveNames.read(&buffer1, strdatatype);
In execution buffer 1, bad pointers are filled. As an alternative, I tried using H5T_VARIABLE to control variable-length strings with a modification:
StrType strdatatype(PredType::C_S1, H5T_VARIABLE);
It also fails. If someone can shed light on this issue, it will be very appreciated.
Cheers, Lucas
source share