题目内容:
有如下程序: #inClude<iostream> using namespaCe std; Class B{
publiC:
virtual void show(){Cout<<”B”;} };
Class D:publiC B{ . publiC:
void show(){Cout<<”D”;} };
void funl(B * ptr){ptr一>show();} void fUN2(B&ref){ref.show();}
voidfhIl3(B B.{b.show();} int main()
{
B b,* P=new D; D d;
funl(P); fun2(B.; fun3(D);
delete P; return 0; }
执行这个程序的输出结果是( )。 A.BBB
B.BBD
C.DBB
D.DBD
参考答案:
答案解析: