Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef unsigned short WORD;
- typedef unsigned int DWORD;
- typedef int LONG;
- typedef unsigned char BYTE;
- #define SIZE_F 32*1024*1024
- int main(int argc, char **argv){
- FILE *pFile = fopen("in.bmp", "r");
- printf("obtain file size\n");
- fseek (pFile , 0 , SEEK_END);
- size_t lSize = ftell (pFile);
- rewind (pFile);
- BYTE* fileData = (BYTE*)malloc(lSize);
- printf("buffering file (size = %d)\n", lSize);
- int result = fread(fileData, 1, lSize, pFile);
- printf("getting offset (buffered = %d)\n", result);
- DWORD bfOffBits = *((DWORD *)*(fileData + 10));
- printf("%d\n", bfOffBits);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement