• 2022-06-01 问题

    下列程序运行结果是 。class A{public:virtual void funcl(){cout&#91;< "A1";}void func2(){cout<< "A2";}};class B: public A{public:void func1(){cout<< "B1";}void func2(){cout<< "B2";}};int main(){A *p=new B;p-&#93;funcl();p->func2();return 0;}

    下列程序运行结果是 。class A{public:virtual void funcl(){cout&#91;< "A1";}void func2(){cout<< "A2";}};class B: public A{public:void func1(){cout<< "B1";}void func2(){cout<< "B2";}};int main(){A *p=new B;p-&#93;funcl();p->func2();return 0;}

  • 1