上一页 1 ··· 271 272 273 274 275 276 277 278 279 ··· 345 下一页
摘要: 前面我们说基类的成员函数可以被继承,可以通过派生类的对象访问,但这仅仅指的是普通的成员函数,类的构造函数不能被继承。构造函数不能被继... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(21) 评论(0) 推荐(0)
摘要: #include #includeusing namespace std;//基类Aclass A{public: A(int... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(15) 评论(0) 推荐(0)
摘要: #include #includeusing namespace std;//基类Aclass A{public: A(int... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(16) 评论(0) 推荐(0)
摘要: #include #includeusing namespace std;//基类Aclass A{public: A(int... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(14) 评论(0) 推荐(0)
摘要: #include #includeusing namespace std;//基类Aclass A{public: A(int... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(12) 评论(0) 推荐(0)
摘要: 类其实也是一种作用域,每个类都会定义它自己的作用域,在这个作用域内我们再定义类的成员,这一点已在《类其实也是一种作用域》中讲到。当存... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(231) 评论(0) 推荐(1)
摘要: 类其实也是一种作用域,每个类都会定义它自己的作用域,在这个作用域内我们再定义类的成员,这一点已在《类其实也是一种作用域》中讲到。当存... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(61) 评论(0) 推荐(0)
摘要: 命名冲突 当两个或多个基类中有同名的成员时,如果直接访问该成员,就会产生命名冲突,编译器不知道使用哪个基类的成员。这个时候需要在成员... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(45) 评论(0) 推荐(0)
摘要: 在前面的例子中,派生类都只有一个基类,称为单继承(Single Inheritance)。除此之外,C++也支持多继承(Multip... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(59) 评论(0) 推荐(0)
摘要: 在前面的例子中,派生类都只有一个基类,称为单继承(Single Inheritance)。除此之外,C++也支持多继承(Multip... 阅读全文
posted @ 2022-08-19 22:47 luoganttcc 阅读(75) 评论(0) 推荐(0)
上一页 1 ··· 271 272 273 274 275 276 277 278 279 ··· 345 下一页