//多继承与赋值兼容性原则 #include<iostream> using namespace std; class Point{ public: Point(){ a = ; b = ; } int a; int b; }; class PointA { public: PointA(){ c = ; } int c; }; class PointB :public Point, public PointA{ }; void ProtectB(){ PointB pb; Point *p1…
//赋值兼容性原则 #include<iostream> using namespace std; class PointA{ public: PointA(){ x = ; y = ; } void Set(){ } private: int x; int y; }; class PointB :public PointA{ public: private: int c; }; /*自己猜想: 赋值兼容性原则内部原理分析 在子类继承父类的时候,在子类的内存区域上,父类的元素会放在前面,子类的…