class base1
{
public:
void display()
{
cout<<"Base1"<<endl;
}
};
class base2
{public:
void display()
{
cout<<"Base2"<<endl;
}};
class derived :public base1, public base2
{
};
任何人都可以解释如何通过派生类对象调用base :: display()。
答案 0 :(得分:0)
我相信你会这样做:
this->base1::display(); // call the display() method as defined in base1
this->base2::display(); // call the display() method as defined in base2
答案 1 :(得分:0)
derived d;
d.base1::display();