题目内容
有如下程序 #include<iostream> using namespace std; class GA{ public: virtual int f( ) {return 1;} }; class GB:public GA{ public: virtual int f() {return 2;} }; void show(GA g){cout<<g.f();} void display(GA&g){cout<<g.f();} int main() { GA a;show(A) ;display(A) ; GB b;show(B) ;display(B) ; return 0; }运行时的输出结果是
查看答案
搜索结果不匹配?点我反馈