例一: #include <iostream> using namespace std; class A { public: char c; }; class B { public: int a; short b; }; class C { public: int a; short b; char Read More
posted @ 2019-04-14 16:26 Brickert Views(2038) Comments(0) Diggs(0) Edit
前因: 1.C++中多重继承,即一个派生类可以有多个基类。如果多个基类有同名成员或同名函数,派生类对象对其访问时会产生二义性。 举例: #include <iostream> using namespace std; class Base1 { public: Base1(int var){cout Read More
posted @ 2019-04-14 15:07 Brickert Views(2010) Comments(0) Diggs(0) Edit