C++虚继承

我们在解决实际问题的时候,多继承和多重继承可能出现下面的情况 这样就使得D中拥有两组A中一模一样的数据,这是不被允许的,为了解决这种情况,我们引入了虚继承 当没有虚继承的时候 #include<iostream> #include <string> using namespace std; class Person { public: Person(string color="pink")
相关文章
相关标签/搜索