I've been following lesson 20 and I just wanted to understand how the bytes of a Bitmap file are put into a structure, I'm not really getting my head around it.
Code: Select all
FILE* bmpFile = fopen( fileName, "wb" );
So here
fopen takes the name of a file on the hard drive and copies the file into the space
bmpFile points to in RAM?
then here
Code: Select all
BitmapFileHeader fileHeader;
fread( &fileHeader,sizeof( fileHeader ),1,bmpFile );
fread copies bytes from RAM that
bmpFile points to, storing them in the members of
fileHeader until it has copied the same amount that
sizeof( fileHeader ) returns?
am i right so far? i just want to know how the bytes are stored in the right members, also whats the third argument of
fread for?