有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数) #include #include main() { char a[10] = "abc", b[10] = "012", c[10] = "xyz"; strcpy( a+1

admin2020-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
0

相关试题推荐
最新回复(0)