I am generating a value by calling some fn which returns uint32_t and storing these values in file. Part of Code as shown below
the above code gives some garble value. I tried the next code which gives me just the first value and with offset again gives garble values.
//to write content in file
// putting value in file using loop
//to read content of file
ifstream myfile ("output");
myfile>>num; // for first record display
printf("value fetched from file: %.8x\n", num);
int record = 2* sizeof(uint32_t); //offset to reach third record
myfile.seekg( record, ios::beg);
printf("value fetched from file: %.8x\n", num1);
File "output" contains the value but i am not able to read the value, may be problem with the offset.