题目内容
有如下程序:#include using namespace std;class B{ public: virtual void show(){cout<<"b";}};class D:public B { public: void show(){cout<<"D";}};void fun1(B*ptr){ ptr->show();}void fun2(B &ref){ ref.show();}void fun3(B b){ b.show();}void main(){ B b,*p=new D; D d; fun1(p); fun2(b); fun3(d);}程序输出的结果为( )
查看答案
搜索结果不匹配?点我反馈
更多问题