测试发现struct也可以有构造函数
struct Msg_DisConnect{
TBYTE msg_type: 8;
Msg_DisConnect()
{
msg_type = 0xE5;
if(ERROR_FLAG)
{
int n = GetTickCount()%101;
if(n<30)
msg_type += n;
}
}
};
上面的程序中使用的构造函数竟然可以!!难怪大家都说class和struct是一样的
2009-09-22 20:20
2009-09-22 20:43

2009-09-24 21:24
2009-09-24 21:40
2009-09-26 18:37

2009-09-26 21:41
2010-07-04 01:52