ookay people, here is the code c++; im trying to read BMP image file.
#include <iostream>
#include <fstream>
using namespace std;
void listing (void) {
unsigned char pixel;
int x, pix;
ofstream debug("debug.txt", ios::out);
ifstream inpaint( "source.bmp",ios::binary);
if(!inpaint) {
cout << "File not opened\n";
exit(1);
}
for(x=1; x<=54; x++) {
inpaint.get(pixel); //<----my problem is here.
pix = pixel;
debug << pix << endl;
}
here i try to get source.bmp data using get() function // inpaint.get(pixel)// an put this info into pixel; which is unsigned char ofcourse. i get error. i think for binary incoming information; unsigned char is better . then i used simpe char // char pixel // and inpaint.get(pixel) worked; why can't i use unsigned char???