How to convert 4 bytes n read from binary file to integer header_offset?
1 2 3 4 5 6
uint32_t header_offset ; char n[4]; size_t in;
...
in = fread(n, 4, 1, fp); // value n is "\000\000\000\020"
if (!in)
return -2;
header_offset = n; // get 4 bytes to integer
The header_offset is position of bitmap in BMP file.
Maybe if there would be a way how to copy byte by byte from left to right - 4 bits on one cycle, I could read the 4 bytes in loop char by char.