I am trying to read a bmp file using fstream. However it skips the values between 08 and 0E (hex) for example, for values 42 4d 8a 16 0b 00 00 00 00 00 36
it reads
42 4d 8a 16 00 00 00 00 00 36
skipping 0b like it does not even exist in the document.
What to do?
code:
ifstream in;
in.open("ben.bmp", ios::binary);
unsigned char a='\0';
ofstream f("s.txt");
while(!in.eof())
{
in>>a;
f<<a;
}
EDIT: using in.read(a,1);
instead of in>>a;
solves the reading problem but I need to write unsigned chars and f.write(a,1);
does not accept unsigned chars. Anybody got a function to do the writing with unsigned chars?