若有如下程序: #include<iostream> using namespace std; class TestClass { public: void who(){cout<<“TestClass”<<endl;} }; class TestClassl:public TestClass { public: void who(){cout<<“TestClassl”<<endl; int main() { TestC
A.TestClassl
B.TestClass
C.0
D.无输出
[单选题]若有如下程序:includeusing namespace std;class TestClass{public:void who() {cout若有如下程序: #include<iostream> using namespace std; class TestClass { public: void who() {cout<<"TestClass"<<endl;} }; class TestClass1:public TestClass { public: void who(){cout<
[单选题]若有如下程序:includeusing namespace std;Class TestClass1{private:int a;public:T若有如下程序: #include<iostream> using namespace std; Class TestClass1 { private: int a; public: TestClassl(int i) { a=i; } void disp() { cout<<a<<“,”; } }; Class TestClass2 { private
[单选题]若有如下程序:includeusing namespace std;class A{public:A(int i,int j){a=i;b=j;}若有如下程序: #include<iostream> using namespace std; class A { public: A(int i,int j) { a=i; b=j; } void move(int x,int y) { a+=x; b+=y; } void show() { cout<<a<<","<<b<<end1; } pr
[单选题]有如下程序:#includeusing namespace std;class A{public:A.(){cout<<"A";}~A(){cout<<"~A";}};class B:public A{A.* p;public:B.(){cout<<"B"; p = new A();}~B(){cout<<"~B"; delete p;}};int main(){B. obj;return 0;}执行这个程序的输出结果是A. . B
[单选题]有如下程序:#includeusing namespace std;class Base{private:void funl() const{cout<<"funl";}protected:void fun2() const{cout<<"fun2";}public:void fun3() const{cout<<"fun3";}};class Derived:protected Base{public:void fun4() const{cout
[单选题]有如下程序:#includeusing namespace std;class Complex{double re, im;public:C.omplex(double r, double i):re(r), im(i){}double real() const{return re;}double image() const{return im;}C.omplex& operator +=(Complex a){re += a.re;im += a.im;return *this;}};
[单选题]有如下程序:#includeusing namespace std;class Base{public:void funl(){cout<<"Base/n";}virtual void fun2(){cout<<"Base/n";}};class Derived:public Base{public:void funl(){cout<<"Derived/n";}void fun2(){cout<<"Derived/n";}};voi
[试题]有如下程序:#includeusing namespace std;class Con{char ID;public:C.on():ID('A'){cout<<1;}C.on(char ID. . :ID(ID. . {cout<<2;}C.on(Con&C. . :ID(c.getID()){cout<<3;}char getID() const{return ID;}};void show(ConC. . {cout<int main(){
[试题]有如下程序:#includeusing namespace std;class PARENT{public:PARENT(){cout<<"PARENT";}};class SON:public PARENT{public:SON(){cout<<"SON";}};int main(){SON son;PARENT *p;p = &son;return 0;}执行上面程序的输出是 ( 12 ) 。
[试题]有如下程序:#includeusing namespace std;class ONE{public:virtual void f(){cout<<"l";}};class TWO:public ONE{public:TWO(){cout<<"2";}};class THREE:public TWO{public:virtual void f(){TWO::f(); cout<<"3";}};int main(){ONE aa, *p;TWO bb;