有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数):
#include< stdio.h >
#include< string.h >
void main()
{
char a[10]="abc",b[10]="012",c[10]="xyz";
strcpy(a+1,b+2);
puts(strcat(a,c+1));
}
程序运行后的输出结果是( )。
【正确答案】 C
【答案解析】先执行strcpy,将b[2]中的2复制到a[1]中的b及之后的存储空间中,即此时数组a中值为a2,再执行strcat连接函数,将c[1]所指的y及之后的z与a连接,即为a2yz。