首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(
以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(
admin
2010-05-22
17
问题
以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是________。
选项
A、xyzabcABC
B、zabcABC
C、yzabcABC
D、xyabcABC
答案
8
解析
strcat(p1,p2)将字符串abcABC放到了*p1所指向的存储单元中;strcpy在本题将abcABC复制到str+2所指向的存储单元中,即覆盖原str数组中的字符z及其后的所有字符,故str的值为“xyabcABC”。
转载请注明原文地址:https://kaotiyun.com/show/EtWp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序的功能是随机产生10个两位的整数:OptionBase1PrivateSubCommand1_Click()Dima(10)AsInteger,iAsIntegerRandomize
数据库系统的核心是
窗体上有一个名称为Commandl的命令按钮。要求编写程序,把文件f1.txt的内容写到文件f2.txt中,然后将f1.txt删除。命令按钮的单击事件过程如下:PrivateSubCommandl_Click()O
阅读程序:OptionBase1PrivateSubForm_Click()Dima(3,3)AsIntegerFori=1To3Forj=1To3a(i,j)=____________Printa(i,j);Nex
假定有以下循环结构DoUntil条件表达式循环体Loop则以下正确的描述是
以下能从字符串“VisualBasic”中直接取出子字符串“Basic”的函数是
在程序运行时,下面的叙述中正确的是
以下关于局部变量的叙述中错误的是
有数据定义语句:Dima,bAsIntegerDimx%,YasInteger执行语句后,不是整型变量的是
表达式Int(Rnd(0)*50)所产生的随机数范围是
随机试题
()是党和国家的生命线、人民的幸福线。
患者,男性,55岁。1小时前因右侧腰背部剧烈疼痛。难以忍受,出冷汗,服颠茄片不见好转,来院急诊。尿常规检查:可见红细胞。B型超声波检查:肾结石。对该患者给予输注利尿治疗,选用呋塞米利尿,该药的不良反应不包括()
A公司和甲签订货物买卖合同,A签发一张5万元的见票即付的汇票作为支付合同价款,但是甲迟迟拖延不履行合同。现持票人被拒绝付款后行使追索权时,关于A公司可以拒绝向持票人付款的情形,下列哪些选项是正确的?
移民安置问题属于对投资项目进行社会评价中的()。
实行施工总承包的,由()统一组织编制水利工程建设生产安全事故应急救援预案。
纳税检查的对象是( )。
甲公司系ABC会计师事务所的常年审计客户,主要从事电子产品的生产和销售。ABC会计师事务所委派X注册会计师担任甲公司2017年度财务报表审计项目合伙人。在审计存货时,x注册会计师编制了相关工作底稿,部分内容摘录如表11—3、表11一4、表11一5所示。资
张某因逆行驾驶被交通警察李某拦截,李某口头作出罚款200元的处罚决定,并要求当场缴纳。张某要求出具书面处罚决定和罚款收据,李某认为其要求属于强词夺理,拒绝听取其申辩。关于该处罚决定,下列哪个说法是正确的?()
尽管象牙交易已被国际协议宣布为非法行为,一些钢琴制造者仍使用象牙来覆盖钢琴键,这些象牙通常通过非法手段获得。最近,专家发明了一种合成象牙,不像早期的象牙替代物,这种合成象牙受到了全世界范围内音乐钢琴家的好评。但是因为钢琴制造者从来不是象牙的主要消费者,所以
A、 B、 C、 A
最新回复
(
0
)