有如下程序:includeusing namespace std;class Base{public:void output( ){cout 有如下程序: #include<iostream> using namespace std; class Base{ public: void output( ){cout<<l;} virtual void Print( ){cout<<'B';} }; class Derived:public Base{ public: void output( ){cout<<1;} void Print( ){cout<<'D';} }; int main( ){ Base*prt=new Derived; prt->output( ); prt->Print( ); delete prt; return 0; } 程序的输出结果是A.1BB.1DC.2BD.2D
有如下程序:includeusing namespace std;class Base{public:void output( ){cout<
有如下程序: #include<iostream> using namespace std; class Base{ public: void output( ){cout<<l;} virtual void Print( ){cout<<'B';} }; class Derived:public Base{ public: void output( ){cout<<1;} void Print( ){cout<<'D';} }; int main( ){ Base*prt=new Derived; prt->output( ); prt->Print( ); delete prt; return 0; } 程序的输出结果是
A.1B
B.1D
C.2B
D.2D
相关考题:
有如下程序:includeusing namespace std;Class Base{public:Base(){cout 有如下程序: #include<iostream.h> using namespace std; Class Base { public: Base(){cout<<“BB”;f();} void{(){cout<<“BF”;} }; class Derived:public Base { public: Derived(){cout<<“DD”;} void f(){cout<<“Df”;) }; int mainA.BBBfDDB.BBDfDDDfC.DDD.DDBBBf
有如下程序:include using namespace std;class Base{public:Base(){cout 有如下程序:#include <iostream>using namespace std;class Base{ public: Base(){cout<<"BB"; f(); } Void f(){cout<<"Bf"; }};class Derived: public Base{ public: Derived() { cout<<"DD"; } void f() { cout<<"Df"; }};int main() { Derived d; return 0; }执行上面的程序将输出( )。A.BBBfDDB.BBDfDDDfC.DDD.DDBBBf
有如下程序:include using namespace std;class BASE{public:~BASE(){cout 有如下程序: #include <iostream> using namespace std; class BASE{ public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED(){cout<<"DERIVED";} }; int main(){DERIVED x;return 0;} 执行后的输出结果是A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE
有如下程序:includeusing namespace std;class BASE{public:~BASE( ){cout 有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE( ){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED( ){cout<<"DERIVED";} }; int main( ){DERIVED x;return 0;} 程序的输出结果是A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE
下列程序的运行结果是______。include class Base { public: void f(int x){cout 下列程序的运行结果是______。include<iostream.h>class Base{public:void f(int x){cout<<“Base:”<<x<<endl;});class Derived:public Base{public:void f(char*str){cout<<“Derived:”<<str<<endl;}};void main(void){Base*pd=ne
有如下程序:include using namespace std;class Base{public:Base(){ cout 有如下程序: #include <iostream> using namespace std; class Base { public: Base(){ cout<<"BB";f(); } void f() { cout<<"Bf";} }; class Derived:public Base { public: Derived() { cout<<"DD"; } void f(){ cout<<"Df"; } }; int main(){ Derived d; return 0;}执行上面的程序将输出______ 。A.BBBfDDB.BBDfDDDfC.DDD.DDBBBf
有如下程序:includeincludeusing namespace std;class BASE{char c;public 有如下程序: #include<iostream>#include<iosream> using namespace std; class BASE{ char c; public; BASE(char n):c(n){} virtual ~ BASE(){cout<<c;} }; class DERIVED; public BASE{ char c; public: DERIVED (char n): BASE (n+1)A.XYB.YXC.XD.Y
有如下程序:include using namespace std;class BASE{public:~BASE() {cout 有如下程序: #include <iostream> using namespace std; class BASE{ public: ~BASE() {cout<<"BASE"; } }; class DERIVED: public BASE { public: ~DERIVED() {cout<;"DERIVED"; } }; int main(){DERIVED x; return 0;} 执行后的输出结果是______ 。A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE
有如下程序:includeusing namespace std;class BASE{public:~BASE(){cout 有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED(){cout<<"DERIVED";} }; int main(){DERIVED x;return 0;} 执行后的输出结果是( )。A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE