#ifdef OLD_HEADER_FILENAME #include #else #include #endif #include #include #ifndef H5_NO_NAMESPACE #ifndef H5_NO_STD using std::cout; using std::endl; using std::vector; #endif // H5_NO_STD #endif #include "H5Cpp.h" #ifndef H5_NO_NAMESPACE using namespace H5; #endif const H5std_string FILE_NAME( "test_compound2.hdf5" ); const H5std_string DATASET_NAME( "data" ); const int LENGTH = 5; const int RANK = 1; #define ShowField(s,f){\ cout << endl<<"Field "<<#f<<" : " << endl; \ for(int i = 0; i < LENGTH; i++)\ cout< datain(LENGTH); for(int i=0; i dataout(LENGTH); dset.read( dataout.data(), mtype ); cout<<"\n===========Data Read==========\n"; ShowField(dataout,a); ShowField(dataout,b); ShowField(dataout,c); cout<<"\nfield c is read back correctly, though not inserted in memtype!\n"; /*Output: ==========Data initialized============= Field a : 0 1 2 3 4 Field b : 0 1 4 9 16 Field c : 0 -1 -2 -3 -4 ===========Data Read========== Field a : 0 1 2 3 4 Field b : 0 1 4 9 16 Field c : 0 -1 -2 -3 -4 */ return 0; }