首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数) #include #include main() { char a[10] = "abc", b[10] = "012", c[10] = "xyz"; strcpy( a+1
有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数) #include #include main() { char a[10] = "abc", b[10] = "012", c[10] = "xyz"; strcpy( a+1
admin
2020-05-19
20
问题
有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数)
#include
#include
main()
{ char a[10] = "abc", b[10] = "012", c[10] = "xyz";
strcpy( a+1, b+2 );
puts( strcat( a, c+1 ) );
}
程序运行后的输出结果是
选项
A、a12xyz
B、bc2yz
C、a2yz
D、12yz
答案
C
解析
本题考查字符串处理函数strcpy和strcat,执行完strcpy( a+1, b+2 );后,a变为a2,执行完strcat( a, c+1 )后,a变为a2yz,所以答案为C选项。
转载请注明原文地址:https://kaotiyun.com/show/XACp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
请编写函数fun,其功能是求出数组的最大元素在数组中的下标并存放在k所指的存储单元中。例如,输入如下整数:876675896101301401980431451777则输出结果为:6,980注意:部分源程序在
程序通过定义学生结构体变量,存储了学生的学号、姓名和3门课的成绩。函数fun的功能是对形参b所指结构体变量中的数据进行修改,最后在主函数中输出修改后的数据。例如:b所指变量t中的学号、姓名、和三门课的成绩依次是:10002、’’ZhangQi’’
内聚性是对模块功能强度的衡量,下列选项中,内聚性较弱的是()。
给定程序MODI1.C中函数fun的功能是:对N名学生的学习成绩,按从高到低的顺序找出前m(m≤10)名学生来,并将这些学生数据存放在一个动态分配的连续存储区中,此存储区的首地址作为函数值返回。请改正函数fun中指定部位的错误,使它能得出正确的结
给定程序MODI1.C中函数fun的功能是:统计字符串中各元音字母(即:A、E、I、O、U)的个数。注意:字母不分大、小写。例如:若输入:THIsisaboot,则输出应该是:1、0、2、2、0。请改正程序中的错误,使它能得出正确的结果。
若有如下说明,且int类型占两个字节,则正确的叙述为()。structst{inta;intb[2];}a;
以下对C语言中联合类型数据的正确叙述是()。
下列程序中,函数fun的功能是:按顺序给s所指数组中的元素赋予从2开始的偶数,然后再按顺序对每5个元素求一个平均值,并将这些值依次存放在W所指的数组中。若s所指数组中元素的个数不是5的倍数,则多余部分忽略不计。例如,s所指数组有14个元素,
下面不能作为结构化方法软件需求分析工具的是()。
在软件开发中,需求分析阶段产生的主要文档是
随机试题
下列哪一项不是寒湿困遏证黄疸的特点
下列不属于免疫增强疗法的是
节点①中剖到几根横梁。
下列关于城镇道路施工安全技术交底的说法中,符合规范要求的是()。
商业银行流动性监管指标中,核心监管指标包括()。
某人投保了一份生死两全保险,后经医院诊断为突发性精神分裂症,治疗期间病情进一步恶化,终日意识模糊狂躁不止,最终自杀身亡。这一死亡事故的近因是()。
关于我国的节气,以下说法不正确的是()。
和谐社会可以理解为()。
已知自行车与摩托车速度比为2:3,摩托车与汽车速度比为2:5,已知汽车15分钟比自行车多走11干米,则自行车30分钟比摩托车少走()千米。
A、ShewantsCoke.B、Shewantscoffee.C、ShelikesChineseteabest.D、Shewantseitherofthem.C本题的问题关键词是what。本题要掌握prefer…to…这
最新回复
(
0
)