/************************************************************ This example shows how to read and write data to a dataset by hyberslabs. The program first writes integers in a hyperslab selection to a dataset with dataspace dimensions of DIM0xDIM1, then closes the file. Next, it reopens the file, reads back the data, and outputs it to the screen. Finally it reads the data again using a different hyperslab selection, and outputs the result to the screen. This file is intended for use with HDF5 Library version 1.6 ************************************************************/ #include "hdf5.h" #include #include #define FILE "h5ex_d_hyper.h5" #define DATASET "DS1" #define DIM0 6 #define DIM1 8 int main (void) { hid_t file, space, dset; /* Handles */ herr_t status; hsize_t dims[2] = {DIM0, DIM1}, start[2], stride[2], count[2], block[2]; int wdata[DIM0][DIM1], /* Write buffer */ rdata[DIM0][DIM1], /* Read buffer */ i, j; /* * Initialize data to "1", to make it easier to see the selections. */ for (i=0; i