这个问题没想明白,大家帮帮忙
char string1[20], string2[]="Hello world";printf("Enter a string:"); // 输入Hello world
scanf("%s",string1);
printf("string1 is:%s\n",string1);
printf("string2 is:%s\n",string2);
输出结果:
string1 is Hello
string2 is Hello world
为什么string2可以输出Hello world,而string1只能输出到Hello呢???
Thank you in advance!