参考网址: http://blog.csdn.net/z1179675084/article/details/14645359
http://hi.baidu.com/guoggn/item/636e08145b5d39fc746a8461
http://blog.chinaunix.net/uid-26669729-id-3077015.html
http://blog.csdn.net/luxiaoxun/article/details/7622988
关键:
1)字节对齐问题__attribute__((packed)) 最大字节对齐
2) _attribute__((packed))的作用是告诉编译器取消结构在编译过程中的优化对齐
3) 字节数的统计
#include
#include
#include
#include
#include
#include /*map头文件*/
#include
#include
#include
#include
//14byte文件头
typedef struct
{
unsigned char cfType[2];//文件类型,"BM"(0x4D42)
unsigned int cfSize;//文件大小(字节)
unsigned int cfReserved;//保留,值为0
unsigned int cfoffBits;//数据区相对于文件头的偏移量(字节)
}__attribute__((packed)) BITMAPFILEHEADER;
/*_attribute__((p