1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Copyright by The HDF Group. *
3 * Copyright by the Board of Trustees of the University of Illinois. *
4 * All rights reserved. *
5 * *
6 * This file is part of HDF5. The full HDF5 copyright notice, including *
7 * terms governing use, modification, and redistribution, is contained in *
8 * the COPYING file, which can be found at the root of the source code *
9 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10 * If you do not have access to either file, you may request a copy from *
11 * help@hdfgroup.org. *
12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
14
15 #include "hdf5.h"
16 #include "hdf5_hl.h"
17
18 #define RANK 2
19
20
main(void)21 int main( void )
22 {
23 hid_t file_id;
24 hsize_t dims[RANK]={2,3};
25 int data[6]={1,2,3,4,5,6};
26
27 /* create a HDF5 file */
28 file_id = H5Fcreate ("ex_lite1.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
29
30 /* create and write an integer type dataset named "dset" */
31 H5LTmake_dataset(file_id,"/dset",RANK,dims,H5T_NATIVE_INT,data);
32
33 /* close file */
34 H5Fclose (file_id);
35
36 return 0;
37 }
38
39
40