Hey,
I've looked over the binary I/O post and read over some tutorials on line, but I still can't make the program read in a binary number properly.
I've tried:
It doesn't interprit DataFormat properly in either case. The input file is binary. to place the poiter at the correct position I use:Code:char num[5]; int DataFormat; inp>>DataFormat; // and inp.read(num, sizeof(long)); num[5] = '\0'; DataFormat = atoi(num);
is there another way to read in 4 bytes into a longint variable fro ma binary file?Code:ifstream inp; inp.open("test.baf", ios_base::binary); inp.seekg(549,ios::beg);