首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include void fun(char *t,char *s) { while(*t!=0) t++; while((*t++=*s++)!=0); } main() { char ss[10]="acc",aa[10
有以下程序 #include void fun(char *t,char *s) { while(*t!=0) t++; while((*t++=*s++)!=0); } main() { char ss[10]="acc",aa[10
admin
2010-12-10
40
问题
有以下程序
#include
void fun(char *t,char *s)
{ while(*t!=0) t++;
while((*t++=*s++)!=0);
}
main()
{ char ss[10]="acc",aa[10]="bbxxyy";
fun(ss,aa); printf("%s,%s\n",ss,aa);
}
程序的运行结果是
选项
A、accxyy,bbxxyy
B、acc,bbxxyy
C、accxxyy,bbxxyy
D、accbbxxyy,bbxxyy
答案
D
解析
本题中fun函数实现了字符串函数strcat的功能,将字符串aa连接到字符串ss的末尾。调用fun函数时,形参t和s分别指向了字符串ss和aa,然后通过一个while循环使t指向字符串ss的结束符的位置,第二个while循环将字符串aa中的字符(包括结束符’\0’)逐个复制到字符串ss的末尾处。
转载请注明原文地址:https://kaotiyun.com/show/l1Pp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下关于函数过程的叙述中,正确的是()。
下列各声明语句中错误的是
在考生文件夹下有一个工程文件sjt5.vbp,界面如图所示,其功能如下:①单击“读数据”按钮,则把考生文件夹下文件in5.dat中的12组整数(其中每组含有10个数,共计120个整数)读到数组a中。②单击“计算”按钮,则对每组数求平均值
编写如下程序:PrivateSubCommand1_Click() Dimstr1AsString,str2AsString str1=InputBox("输入一个字符串") subfstr1,str2 Prints
窗体上有一个菜单编辑器设计的菜单。运行程序,并在窗体上单击鼠标右键,则弹出一个快捷菜单,如图所示。下列说法错误的是()。
3.一棵二叉树中共有80个叶子结点与70个度为1的结点,则该二叉树中的总结点数为
有两个关系R,S如下,由关系R和S得到关系T,则所使用的操作为
有如下函数过程:Functionfl(xAsInteger)AsLongDimsAsLongDimiAsIntegers=nFori=1Toxs=s+iNextifl=sEndFunction在窗体上添加一个
数据库技术的根本目标是()。
在软件生命周期中,能准确地确定软件系统必须做什么和必须具备哪些功能的阶段是()。
随机试题
12型链条式抽油机的优点有哪些?
凝集反应是可溶性抗原与相应抗体在适当电解质存在下形成肉眼可见的凝集现象。
低价倾销低于成本出售过季商品
甲与乙打架时丙正好路过,其不慎被丢来的石块砸伤遂起诉到法院要求甲、乙赔偿医疗费、误工费等损失。法院组成合议庭审理本案。根据案情回答以下问题:丙知晓审判员丁和甲之间有师生关系,法院的院长也知道书记员戊是乙的姐夫,那么关于本案的回避,下列说法正确的是:(
From:ChadBecker,theDirectorofPersonnelTo:EmployeesOurfinancialadvisorshavefinallyreacheda【K4】______onaplan
下面的式子中,()是方程。
试运用国际收支的货币主义理论分析货币贬值能否真正解决一国国际收支的逆差问题。
2019年以来,朝鲜半岛局势继续吸引了全世界的目光。在朝美领导人会晤未取得明显进展之后,2019年初,朝鲜要求美方更换双方会谈团队负责人蓬佩奥,但美方未予理睬,朝美谈判再次陷入僵局,美国解除对朝鲜制裁也遥遥无期。2019年4月下旬,金正恩访俄并与普京会谈。
下列关于函数的叙述中,正确的是
ThematurityofITindustryandtheintegrationofITintothemainstreamofeconomicactivityand______constraintshaveforce
最新回复
(
0
)