class test
{
public:
enum type{One,Two, Three};
private:
};
int _tmain(int argc, _TCHAR* argv[])
{
cout << sizeof(test)<<endl;
return 0;
}
class test
{
public:
enum type{One=2,Two, Three};
test():t(One)
{
}
type getT()
{
return t;
}
private:
type t;
};
int _tmain(int argc, _TCHAR* argv[])
{
test s;
cout << sizeof(test)<<endl;
cout<<s.getT()<<endl;
cout << test::Three<<endl;
return 0;
}
struct CEType
{
enum EType1 { e1, e2 };
enum EType2 { e1, e2 };
};
原文:http://www.cnblogs.com/chengkeke/p/5417368.html