首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<e
下面程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<e
admin
2016-10-28
44
问题
下面程序的输出结果是( )。
#include<iostream.h>
#include"string.h"
void main()
{char a[]="Hello Test",b[]="Test";
strcpy(a,b);
cout<<a<<endl;
}
选项
A、Hello
B、Test
C、Hello Test
D、Hello Test HelloTest
答案
B
解析
程序中首先定义字符数组a和b,其值分别为“Hello Test”和“Test”。然后利用strcpy复制函数,将b的值复制给a,所以输出a的结果为Test。
转载请注明原文地址:https://kaotiyun.com/show/eONp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的输出结果是#include<iostream.h>voidmain(){char*str="12123434";intx1=0,x2=0,x3=0,x4=0,i;for(i=0;str[
以下能对二维数组a进行正确初始化的语句是
以下类定义中可能会引起错误的语句是classA{public:~A(){}//1inti;//2private:
流操作子______可跳过输入流中的前导空白字符。
mystrlen函数的功能是计算str所指字符串的长度,并作为函数值返回,请填空。intmystrlen(char*str){inti;for(i=0;______!=’\0’;i++);
下面叙述不正确的是
下列数据模型中,具有坚实理论基础的是
下面对对象概念描述错误的是
下列运算符中,在C++语言中不能重载的是
在设计程序时,应采纳的原则之一是
随机试题
_____weneedmoreequipmentisquiteobvious.
肾脏解剖描述中哪一项是错误的()
A.LD1>LD2B.LD1/LD2倒置且伴有LDH5增高C.LD5>LD4D.LD4和LD5都升高E.LD3和LD4都升高恶性肿瘤肝转移
无形资产是指企业长期使用但没有实物形态的资产,它包括()。
在编写事务时,下列不属于降低事务隔离级别所带来的好处的是()。
一间宿舍可住多个学生,则实体宿舍和学生之间的联系是______。
Americanwomenexperienceagreat【1】oflifestyles.A"typical"Americanwomanmaybesingle.Shemayalsobedivorcedormarried
IntelligentandEnergy-savingSolarHomeA)Ifsomegroupgaveoutawardsfortheleastenergy-efficientstructures—thewaythose
标准规定,城际之间投递包裹的时间不得超过72小时,否则将被认定为延误,顾客即有权索赔。
A、MorepumpkinsareneededtocelebrateHalloween.B、Thesupplyforsalehasdecreased.C、Morepeopledeveloptheirloveforpum
最新回复
(
0
)