C++相談室 part21
■ このスレッドは過去ログ倉庫に格納されています
0180デフォルトの名無しさん
NGNGこれは、例えば int の 4 バイト(の環境として)が
連続する 4 つのバイトに確保される、ということでは?
○ xxxxooooxxxxxxxx
× xxxxooxxoxxxoxxx
で、規格見つけた。
5.3.3 -2- より抜粋
When applied to a class, the results is the number of bytes
in an object of that class including any padding
required for placing objects of that type in an array.
クラスに(sizeof を)適用した場合の結果は、
配列として配置した場合に要求されるあらゆるパディングを含めた、
そのクラスのオブジェクトのバイト数になる。
■ このスレッドは過去ログ倉庫に格納されています