网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列程序执行结果是 include class A { public: int a; A( ):a(10){tout<
下列程序执行结果是
#include<iostream.h>
class A
{ public:
int a;
A( ):a(10){tout<<a<<endl;}
};
void main( )
{ A obj1;
A obj2(obj1);
cout<<" "<<obj2.a<<endl;
}
A.10 10
B.编译错误缺少拷贝构造函数
C.10 随机数
D.随机数随机数
参考答案
更多 “ 下列程序执行结果是 include class A { public: int a; A( ):a(10){tout 下列程序执行结果是#include<iostream.h>class A{ public:int a;A( ):a(10){tout<<a<<endl;}};void main( ){ A obj1;A obj2(obj1);cout<<" "<<obj2.a<<endl;}A.10 10B.编译错误缺少拷贝构造函数C.10 随机数D.随机数随机数 ” 相关考题
考题
下列程序执行结果是()。includeclass A{public:int a;A():a(10){cout
下列程序执行结果是( )。 #include<iostream.h> class A {public: int a; A():a(10){cout<<a<<endl;} }; void main() { A obj1; A obj2(obj1); cout<<""((obj2.a<<endl; )A.10 10B.编译错误缺少拷贝构造函数C.10随机数D.随机数随机数
考题
下列程序的运行结果是【 】。 include class SomeClass { public: SomeClass(int va
下列程序的运行结果是【 】。include <iostream. h>class SomeClass{public:SomeClass(int value) { some_value=value;};void show_data(void) { cout<<data<<"<<~some_value<<endl; };static void set_data(int value) {data=value; }private:static int data;int some_value};int SomeClass::datavoid main(void){SomeClass my_class(1001),your_class(2002);your_class. set_data(4004);my_elass. show_data()}
考题
根据下列程序的执行结果,可以断定划线部分的修饰符应为______。执行结果:i9a football is created.a football is created.i=10a football is destroyed.a football is created.i=20a football is destroyed.a football is destroyed.源程序:include<iostream.h>class Football{public:Football( ){cout<<"a football is created."<<endl;}~Football( ){tout<<"a football is destroyed."<<endl;}};void func(int i){______Football f1;Football f2;cout<<"i="<<i<<endl;}void main( ){func(10);func(20);}
考题
下列程序的运行结果是______。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 class base { public: virtual void who(){c
以下程序的执行结果是______。include<iostream.h>class base{public:virtual void who(){cout<<"base class"<<endl:}};class derrvel:public base{public:void who(){cout<<"derivel class"<<endl:}};class derive2;public base{public:void who() {cout<<"derive2 class"<<endl;}};void main(){base obj1,*P;derive1 obj2;derive2 obj3:p=obj1;p->who();p=obj2:p->who();p=obj3;p->who();}
考题
下列程序执行结果是 include class A { public: int a; A(
下列程序执行结果是 #include <iostream.h> class A { public: int a; A():a(10){cout<<a<<endl;} }; void main() { A obj1; A obj2(obj1); cout<<" "<<obj2.a<<endl; }A.10 10B.编译错误缺少拷贝构造函数C.10随机数D.随机数随机数
考题
下列程序的执行结果为______。include void main() { cout.fill(‘*’); tout.width(10
下列程序的执行结果为______。include<iostream.h>void main(){cout.fill(‘*’);tout.width(10);cout<<“hello”<<endl;)
考题
下列程序的运行结果是______。 include class Base { public: virtual void func(int
下列程序的运行结果是______。include<iostream.h>class Base{public:virtual void func(int i){cout<<"class Base:"<<i<<end1;)};class Derived: public Base{public:void func(double d){cout<<"class Derived:"<<d<<endl;}};void main( ){Base a,*p=a;Derived b;p=b;(*p).func(3.3);}
考题
以下程序的执行结果是______. include c1ass A { public: virtual void funl ()
以下程序的执行结果是______.include<iostream.h>c1ass A{public:virtual void funl () { cout<<"A fun1"<<endl;}virtual void fun2 () {cout<<"A fun2"<<endl;void fun3 () {cout<<" A fun 3 "<<endl:)void fun4 () {cout<<" A fun4 "<<endl:}
热门标签
最新试卷