摘要:
#include#include#includeusing namespace std;/* 4.6.3 继承中的对象模型*/class Base{public: int a;protected: int b;private: int ... 阅读全文
posted @ 2021-03-17 09:58
yub4by
阅读(22)
评论(0)
推荐(0)
摘要:
#include#include#includeusing namespace std;/* 4.6.2 继承方式 公共继承 保护继承 私有继承*/class Base{public: int a;prot... 阅读全文
posted @ 2021-03-17 09:57
yub4by
阅读(20)
评论(0)
推荐(0)
摘要:
#include#include#includeusing namespace std;/* 4.6 继承 4.6.1 继承的基本语法 继承优点:减少重复代码 语法: class 子类 :继承方式 父类{} ... 阅读全文
posted @ 2021-03-17 09:56
yub4by
阅读(29)
评论(0)
推荐(0)
摘要:
#include#include#includeusing namespace std;/* 4.5.6 函数调用运算符重载 函数调用运算符()也可以重载 由于重载后使用的方式很像函数的调用,故也称为仿函数 仿函... 阅读全文
posted @ 2021-03-17 09:50
yub4by
阅读(43)
评论(0)
推荐(0)