更多"有如下程序: #include <iostream> usin"的相关试题:
[单项选择]有如下程序
#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<<"F1Derive";
void f2(intx)
cout<<"F2Derive";
;
int main( )
base obj1,*p;
derive obj2;
p=&obj2;
p->f1( );
p->f2( );
return 0;
执行后的输出结果是( )。
A. F1Derive F2Base
B. F1Derive F2Derive
C. F1Base F2Base
D. F1Base F2Derive