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.
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; int DataFormat; inp>>DataFormat; // and inp.read(num, sizeof(long)); num = '\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);