有如下程序 #include<iostream> using namespace std; class base { public: virtual void f1( ) { cout<<"F1Base"; } virtual void f2( ) { cout<<"F2Base"; } }; class derive:public base { void f1( ) { cout<<"F1 Derive"; } void f2(int x) { cout<<"F2 Derive"; } }; int main( ) { base obj1,*p; derive obj2; p=& obj2; p->f1( ); p->f2( ); return ( ); ) 执行后的输出结果是( )。
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 17:31:21
免费下载:《单选题》Word试卷
有如下程序 #include<iostream> using namespace std; class base { public: virtual void f1( ) { cout<<"F1Base"; } virtual void f2( ) { cout<<"F2Base"; } }; class derive:public base { void f1( ) { cout<<"F1 Derive"; } void f2(int x) { cout<<"F2 Derive"; } }; int main( ) { base obj1,*p; derive obj2; p=& obj2; p->f1( ); p->f2( ); return ( ); ) 执行后的输出结果是( )。
A.F1Derive F2Base
B.F1Derive F2Derive
C.F1Base F2Base
D.F1Base F2Derive
本题关键词:程序,有序镜检,工程施工程序,复苏程序,工作程序,建设程序,程序变更,程序冲突,点火程序,生产程序;