I would like to know how to read a bitmap file as input to a
program. Can you for example use the string handling functions
fgetc() and fgets() or would you use fread()?
I need to be able to compare two bitmaps and return a bool result to indicate that they are identical or non-identical.
In essence how would you go about comparing bitmaps ?
would you be comparing the numerical data for each pixel,
pixel by pixel ?
fread() is certainly more appropriate. a bmp is a big ol buffer of scanlines and it would be quite slow and foolish to read one byte at a time. That having been said, do you know the format of a DIB? if not, look up BITMAPFILEHEADER, BITMAPINFOHEADER, BITMAPINFO, RGBQUAD and RGBTRIPLE. Plus there is a big ol bunch of fun about padding scan lines to 4 byte boundaries. You'll like that. ;)