#include<iostream>
using namespace std;
class A
{
public :
void eat()
{
cout<<"A eat B"<<endl;
}
};
class B{
public:
void eat()
{
cout<<"B eat C"<<endl;
}
};
class C:public A,public B
{
public:
};
int main()
{
C c;
//c.eat() 错误
c.A::eat();
c.B::eat();
return 0;
}
using namespace std;
class A
{
public :
void eat()
{
cout<<"A eat B"<<endl;
}
};
class B{
public:
void eat()
{
cout<<"B eat C"<<endl;
}
};
class C:public A,public B
{
public:
};
int main()
{
C c;
//c.eat() 错误
c.A::eat();
c.B::eat();
return 0;
}