3 回答

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超4個(gè)贊
.CPP
enums
class test {public: const static unsigned char X = 1; const static unsigned char Y = 2; ... test();};test::test() {}
.H
.CPP
class test {public: static unsigned char X; static unsigned char Y; ... test();};
unsigned char test::X = 1;unsigned char test::Y = 2;test::test(){ // constructor is empty. // We don't initialize static data member here, // because static data initialization will happen on every constructor call.}

TA貢獻(xiàn)1835條經(jīng)驗(yàn) 獲得超7個(gè)贊
__declspec(dllexport)
- 3 回答
- 0 關(guān)注
- 500 瀏覽
添加回答
舉報(bào)