I am reading the header of a bmp file. My system and bmp file values are both in little endian format. So I read as below:
uint32_t fileSize;
fread(&fileSize,1,4,bmpFile);
In bmp file, these bytes are ordered as: ... 36 04 01 00 ... The resulting value of the fileSize is 66614 which is: 0x00010436. I get the correct value and there is no problem.
However something bothers me. Does this code work similarly for a big endian machine or does fread() behave differently and I get 0x36040100 incorrectly?