请教字符串复制出现的问题!
程序:#include<stdio.h>
#include<string.h>
int main()
{
char s1[]="nihaone nihaoa nihaobu nihaihaoa\n ";
char s2[]="good good study,day day up!\n";
char s3[]="misssing you!\n";
printf(s1);
printf(s2);
printf(s3);
strcpy(s1,s2);
strcpy(s3,s2);
printf(s1);
printf(s2);
printf(s3);
return 0;
}
输出结果:
nihaone nihaoa nihaobu nihaihaoa
good good study,day day up!
misssing you!
good good study,day day up!
day day up!
good good study,day day up!
问题:为什么字符串S2在第二次打印的时候变成了:day day up! 而不是:good good study,day day up!
先谢谢了,呵呵