注意:此页面搜索的是所有试题
[分析题,4分] class my_ base{ int a,b; public: base(int x,int y) {a=x;b=y;} virtual void show(){ cout<<“base”; cout< } }; class my_class:public base{ int c: public: my_class(int x,int y,int z):my_base(x,y){c=z;} void show(){cout<<“my_class ”<<“c=”< } void main { my_base mb(50,50),*mp; my_class mc(10,20,30); mp=&mb; mp->show(); mp=&mc; mp->show(); }

参考答案