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
相關文章
相關標籤/搜索