有以下程序 #include<stdio.h> main() void fun(char*t,char*s) {char ss[10]="acc",aa[10]="bbxxyy"; {while(*t!=0)t++; fun(ss,aa);print

admin2016-12-18  30

问题 有以下程序
#include<stdio.h>  main()
void fun(char*t,char*s)  {char ss[10]="acc",aa[10]="bbxxyy";
{while(*t!=0)t++;  fun(ss,aa);printf("%s,%s\n",ss,aa);
while((*t++=*s++)!=0);}  }
程序的运行结果是

选项 A、acc,bbxxyy
B、accxxyy,bbxxyy
C、accbbxxyy,bbxxyy
D、accxyy,bbxxyy

答案C

解析 fun函数中,第1个while循环语句使指针t指向字符串的末尾,第2个while循环语句实现了字符串t和s的连接。主函数中语句fun(ss,aa)的功能是将字符串aa连接到字符串ss的末尾。
转载请注明原文地址:https://kaotiyun.com/show/SyDp777K
0

最新回复(0)