可能重复: Why isn’t sizeof for a struct equal to the sum of sizeof of each member? 为什么这种结构的16个字节的sizeof();?我正在编译g ++。 struct bitmapfileheader {
unsigned short bfType;
unsigned int bfSize;
可能重复: Why isn't sizeof for a struct equal to the sum of sizeof of each member? Extra bytes when declaring a member of a struct as uint32_t 出于某种原因,该sizeof操作者返回一个假的尺寸为这样的结构(的48代替40): typedef struct mbdb