这是个简单的程序,但我找了很久,都发现不了它的错误
#include<iostream>using namespace std;
class C0
{
public:virtual void print() const =0;
};
class C1:private C0
{
public:
void print()
{
cout<<"C1"<<endl;
}
};
class C2:public C0
{
public:
void print()
{
cout<<"C2"<<endl;
}
};
class C3:public C1,public C2
{
public:
void print()
{
cout<<"C3"<<endl;
}
};
int main()
{
C3 obj3;
C2 obj2;
obj3.print();
ojb2.print();
return 0;
}