/************************************************************ This example shows how to read and write array datatypes to a dataset. The program first writes integers arrays of dimension ADIM0xADIM1 to a dataset with a dataspace of DIM0, then closes the file. Next, it reopens the file, reads back the data, and outputs it to the screen. This file is intended for use with HDF5 Library version 1.6 ************************************************************/ #include "hdf5.h" #include #include #define FILE "h5ex_t_array.h5" #define DATASET "DS1" #define DIM0 4 #define ADIM0 3 #define ADIM1 5 int main (void) { hid_t file, filetype, memtype, space, dset; /* Handles */ herr_t status; hsize_t dims[1] = {DIM0}, adims[2] = {ADIM0, ADIM1}; int wdata[DIM0][ADIM0][ADIM1], /* Write buffer */ ***rdata, /* Read buffer */ ndims, i, j, k; /* * Initialize data. i is the element in the dataspace, j and k the * elements within the array datatype. */ for (i=0; i