使用Union 出错???急救!!!
class CTest
{
public:
class Cls_tt
{
public:
print(){} ;
private:
long i ;
};
struct Stru_tt
{
long i
long j
};
union{
Cls_tt t1 ;
Stru_tt t2 ;
};
};
为什么会出现错误:
e:\test.h(148) : error C2620: union '__unnamed' : member 't1' has user-defined constructor or
non-trivial default constructor
这种情况该怎么用???