C++类中嵌套enum(枚举)、union(联合)、struct(结构体)类型

1、枚举 #include <iostream> using namespace std; class test { public: enum type{ One=2,Two, Three }; test():t(One) {} type getT() {return t;} private: type t; }; int main() { test
相关文章
相关标签/搜索