我减速字符从用户获得输入的字符串后,输出包括某些其它字符(多个)
char strs[3][200] = {'\0'};
的矩阵,然后尝试插入串只对于第一行
gets(strs[0]);
然后尝试打印所有行
printf("1) ");
puts(strs[0]);
printf("2) ");
puts(strs[1]);
printf("3) ");
puts(strs[2]);
结果是
1) ☺me input from the user
2) ☺
3) ☺
为什么结果中会出现“笑脸”?
'gets()'是危险的。改用'fgets()'。 –
尝试'char strs [3] [200] = {{'\ 0'}};'。如果这不起作用,则提供[MCVE](http://stackoverflow.com/help/mcve)。顺便说一句,你的输入和结果不匹配。 –
从哪里得到第四个输出?它看起来你的源文件包含一些奇怪的字符。 –