题目内容:
有如下程序: #include<iostream>
using namespace std;
class Instrument{
public:
virtual void Display()=0;
};
class Pian0:public Instrument}
public:
void Display(){/*函数体略*/}
};
intmain(){
Instrument S;
Instrument*P=0:
//…;
return 0;
}
下列叙述中正确的是( )。 A.语句“Insturment*P=0;”编译时出错
B.语句“Instnunent s;”编译时出错
C.类Pian0中的Display函数不是虚函数
D.类Instrument是一个虚基类
参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析: