结构体内存对齐问题
想自己写个读取BMP文件的类
24位BMP图 头文件是54字节
写了如下结构体
typedef struct BitmapHeader
{
char id[2]; // 这里补了2字节
unsigned int file_size;
unsigned int reserved;
unsigned int bitmap_data_offset;
unsigned int bitmap_header_size;
unsigned int width;
unsigned int height;
unsigned short pianes;
unsigned short bit_depth;
int compression;
unsigned int bitmap_data_size;
unsigned int hres;
unsigned int vres;
unsigned int colors;
unsigned int important_colors;
}BitmapHeader;