摘要: 代码1 #include <iostream> using namespace std; class A{ public: A(int _a):ma(_a){ cout<<"A()"<<endl; } ~A(){ cout<<"~A()"<<endl; } protected: int ma; }; 阅读全文
posted @ 2022-11-29 21:51 Hello_Bugs 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 虚基类/抽象类 抽象类:有纯虚函数的类 代码1 class A{ public: int ma; protcted: int mb; private: int mc; } //B继承 A, class B : public A{ public: int md; potected: int me; p 阅读全文
posted @ 2022-11-29 15:16 Hello_Bugs 阅读(124) 评论(0) 推荐(0) 编辑