This example shows how to create datasets.
#ifdef OLD_HEADER_FILENAME
#include <iostream.h>
#else
#include <iostream>
#endif
#include <string>
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDS.h5" );
const H5std_string DATASET_NAME( "IntArray" );
const int NX = 5;
const int NY = 6;
const int RANK = 2;
int main (void)
{
int i, j;
int data[NX][NY];
for (j = 0; j < NX; j++)
{
for (i = 0; i < NY; i++)
data[j][i] = i + j;
}
try
{
H5File file( FILE_NAME, H5F_ACC_TRUNC );
hsize_t dimsf[2];
dimsf[0] = NX;
dimsf[1] = NY;
datatype.setOrder( H5T_ORDER_LE );
}
{
return -1;
}
{
return -1;
}
{
return -1;
}
{
return -1;
}
return 0;
}