有如下程序 #include <iostream> using namespace std; class A{ public:virtual void funcl( ){ cout<<"A1"; }void func2( ) { cout<<"A2"; }; class B:public A { public:void funcl( ){ cout<<"B1"; }void func2( ){ cout<<"B2"; } }; int main( ) {A *p=new B;p->func1 ( );p->func2( );return 0; } 运行此程序,屏幕上将显示输出
A.B1B2
B.A1A2
C.B1A2
D.A1B2