题目内容

有如下程序:#include using namespace std;class base{public:base(int x=0){cout<

A. 0
B. 1
C. 01
D. 001

查看答案
更多问题

有如下程序:#includeusing namespace std;class Base{protected:Base(){cout<<'A';}Base(char c){cout<

A. B
B. AB
C. BA
D. BB

有如下程序:#includeusing namespace std;class Base{int a,b;public:Bace(int x ,int y) { a=x; b=y;}void show(){ cout<show();return 0;}运行时输出的结果是()。

A. 10,20
B. 20,30
C. 30,40
D. 50,50

有如下程序:#include using namespace std:class B{public:virtual void show(){cout<<'b';}};class D:public B {public:void show(){cout<<'D';}};void fun1(B*ptr){ptr->show();}void fun2(B &ref){ref.show();}void fun3(B b){b.show();}int main(){B b,*p=new D;D d;fun1(p);fun2(b);fun3(d);return 0;}程序的输出结果是()。

A. BDD
BBD
C. DBB
DBD

有如下程序:#includeusing namespace std;class A{public:virtual void func1(){cout<<"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->func1();p->func2();delete p;return 0;}运行时的输出结果是()。

A1B2
B1A2
C. B1B2
D. A1A2

答案查题题库