题目内容
分析下列程序,写出程序运行结果____。#includeusing namespace std;class A{public:virtual void f( ){cout<<1; }void g( ){ cout<<2; }};class B: public A {public:virtual void f( ){ cout<<3; }void g( ){ cout<<4; }};void show( A &a) { a.f( ); a.g( ); }void print(A *p){ p->f(); p->g();}int main(void){B b;show(b);print(&b);cout<
查看答案
搜索结果不匹配?点我反馈
更多问题