题目内容:
下面程序的运行结果是 #include
classbase
{
protected:
inta;
public:
base(){cout<<”0”;}
classbasel:virtualbase
}
public:
base1(){cout<<”1”;}
};
classbase2:virtualbase
{
public:
base2(){cout<<”2”;(
};
classderived:publicbase1,publicbase2
{
public:
derived(){cout<<”3”;}
};
voidmain()
{
derivedobj;
cout<
} A.0123
B.3120
C.0312
D.3012
参考答案:
答案解析: