2011-04-23から1日間の記事一覧

boolのアラインメント

#include <stdio.h> struct BoolAlign { bool _bool0; int _int0; bool _bool1; bool _bool2; int _int1; bool _bool3; bool _bool4; bool _bool5; int _int2; bool _bool6; bool _bool7; short _short0; bool _bool8; short _short1; bool _bool9; int _int3; }; int</stdio.h>…

コンストラクタを含む構造体は初期化子リストで初期化出来ない。

C++

struct DATA { int _hoge; int _fuga; int _piyo; DATA() : _hoge(0) , _fuga(0) , _piyo(0) {} }; int main() { // error C2552 DATA data[3] = { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 }, }; return 0; } Download Visual Studio 2005 Retired documentati…