struct tag1{ unsigned int a :1; unsigned int :2; unsigned int b :4; short id; };
struct tag2{ unsigned int b :4; short id; }; 構造体tag1、tag2ともsizeofでサイズを見てみると6でした。 なぜ6となったのでしょうか? ------------------------------------------------------------------ int型のサイズは4バイト、short型のサイズは2バイトのOS(WinXP)で実行。 VCの設定項目である構造体メンバのアライメントは1バイトに設定しています。 ------------------------------------------------------------------