若有说明char s1[]=“the boy”,s2[]=“is headsome”;,则使用函数strcpy(s1,s2)后A.s1的内容不变 B.有可能导致数据错误 C.s1的内容更新为the boy is headsome D.s1的内容更新为is headsome 为什么?

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/26 02:40:34

若有说明char s1[]=“the boy”,s2[]=“is headsome”;,则使用函数strcpy(s1,s2)后
A.s1的内容不变
B.有可能导致数据错误
C.s1的内容更新为the boy is headsome
D.s1的内容更新为is headsome
为什么?

因为strlen(s2) > strlen(s1) ; 你懂的,