首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"adc"); Strcpy(&S[1],"def"); strcpy(&S[2],"gh");; printf("%S\n",s); 则程序运行后的输出结果是【 】。

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“若有如下程序: include "stdio.h" main…”相关的问题
第1题
若有以下程序:#include <iostream>using namespace std;class point{private: int x, y;public:

若有以下程序: #include <iostream> using namespace std; class point { private: int x, y; public: point () { x=0; y=0; } void setpoint(int x1,int y1) { x=x1; y=y1;

A.12,12

B.5,5

C.12,5

D.5,12

点击查看答案
第2题
若有以下程序:#include using namespace std ;class Base{public :void Fun() { cout << &
若有以下程序:#include using namespace std ;class Base{public :void Fun() { cout << &

若有以下程序:

#include using namespace std ;class Base{public :void Fun() { cout << "1" << endl ;}};class Derived : public Base{public :void Fun() { cout << "2" << endl ; }};int main()

{Derived a;Base * p;p=&a;p-> Fun();a. Fun();return 0;}上面程序的输出结果为:

点击查看答案
第3题
有如下程序:#include<iostream>using namespace std;Class A{public:A(){cout<<“A”;}~A(){cout<<

有如下程序: #include<iostream> using namespace std; Class A { public: A(){cout<<“A”;} ~A(){cout<<“~A”;} }; A*p; public: B(){cout<<“B”;p=new A;} ~B(){cout<<“~B”;delete p;} }; B obj; return 0; ) 执行这个程序的输出结果是(

A.BAA~A~B~A

B.ABA~B~A~A

C.BAA~B~A~A

D.ABA~A~B~A

点击查看答案
第4题
有如下程序:#include<iostream>#include<cstring>using namespace std;class XCF{in

有如下程序:

#include<iostream>

#include<cstring>

using namespace std;

class XCF{

int a;

public:

XCF(int aa=O):a(aA){cout<<”1”;}

XCF(XCF&X){a=x.a;cout<<”2”;}

~XCF(){cout<<at}

int Geta(){return at}

};

int main(){

XCF dl(5),d2(d1);

XCF半pd=new XCF(8);

cout<<pd->Geta();

delete pd;

return 0;

}

运行时的输出结果是

A.1215588

B.1218855

C.12185

D.128512

点击查看答案
第5题
有如下程序: include<iostream> using namespace std; class A { public: virtual void f(){cout

有如下程序:

include<iostream>

using namespace std;

class A

{

public:

virtual void f(){cout<<"1";}

};

class B:public A

{

public:

B (){cout<<"2";}

};

class C:public B

{

public:

virtual void f(){B::f();cout<<"3";}

};

int main()

{

A aa,*p;

B bb;

C cc;

p=&cc;

p->f();

return 0;

}

执行上面程序的输出是______。

点击查看答案
第6题
有如下程序:#includeusing namespace std;int main(){void function(double val);double v

有如下程序:

#include

using namespace std;

int main()

{

void function(double val);

double val;

function(val);

cout<

return 0;

}

void function(double val)

{

val = 3;

}

编译运行这个程序将出现的情况是

A .编译出错,无法运行

B .输出: 3

C .输出: 3.0

D .输出一个不确定的数

点击查看答案
第7题
有如下程序:#include <iostream.h>using namespace std;class Demo{public:Demo(){ cout<<"defau

有如下程序: #include <iostream.h> using namespace std; class Demo { public: Demo(){ cout<<"defautt constmctor\n"; } Demo(const Demo &x){cont<<"copy constmctor\n";} }; Demo userCode (Demo b){Demo c(b);return c;} int main() { Demo a,d; cout<<"calling userCode()\n"; d=userCode(a); return 0; } 执行上面程序的过程中,构造函数Demo()和Demo(const Demo&x)被调用的次数分别是()。

A.1和1

B.1和2

C.2和3

D.2和4

点击查看答案
第8题
若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); st

若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); strcpy(&s[1],"de"); strcpy(&s[2],"f"); printf("%s\n",s); } 则程序运行后的输出结果是【 】。

点击查看答案
第9题
有以下程序 include <lostream> using namespace std; int main() { int

有以下程序 include <lostream> using namespace std; int main() { int i=010,j=10; cout<<(i)<<","<<j--<<endl; return 0; } 则该程序运行后的输出结果是【 】。

点击查看答案
第10题
以下程序输出的结果是()。#include<iostream>using namespace std;int main(){int **x,*y,z=10;y=

以下程序输出的结果是()。 #include<iostream> using namespace std; int main() { int **x,*y,z=10; y=&z; x=&y; cout<< **x+1<<endl; return 0; }

A.11

B.x的地址

C.y的地址

D.运行错误

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改