摘要: 1 #include <iostream> 2 #include<string> 3 using namespace std; 4 5 class Point { 6 public: 7 Point(int a, int b) :x(a), y(b) {}; 8 //Point(Point& p) 阅读全文
posted @ 2020-01-05 16:34 Chenjin123 阅读(3036) 评论(0) 推荐(0) 编辑
摘要: public: 公有继承时,对基类的公有成员和保护成员的访问属性不变,派生类的新增成员可以访问基类的公有成员和保护成员,但是访问不了基类的私有成员。派生类的对象只能访问派生类的公有成员(包括继承的公有成员),访问不了保护成员和私有成员。 protected: 保护继承中,基类的公有成员和保护成员被派 阅读全文
posted @ 2020-01-05 14:01 Chenjin123 阅读(1986) 评论(0) 推荐(1) 编辑