可能重複: 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
可能重複: 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;