在c++中用gets输入,结果输出后出现了一些乱码
int main () {char str[100]; gets(str);}
char str[100]; 改为 char str[100]={'\0'};
你贴一下你的完整代码看看
代码贴全啊,字符串结束符被弄丢了