codeblocks运行一段程序老是出现停止运行

执行到这段的输入名字,一按回车就停止运行
case 2:
printf("请输入要训练的英雄:\n");
scanf("%s",Tname[1]);
for(i=0;i<5;i++)
{
if(strcmp(Tname[1],names[i])==0)
{
printf("已经找到你要训练的英雄。\n");
}
else
{
printf("这个英雄不存在。\n");
}
}

源文件.c-->通过编译器生成.o(目标文件)-->+通过连接器,调用库函数代码+删注释+外部函数价码--->生成可执行文件.exe;
从这个过程来讲,compiler编译器不知道,即缺失;手动添加就可以了。
如果编译没问题 但是一运行 就会自动弹出 .exe已经停止工作 也没显示代码有错误之类 我是用CodeBlocks 运行的 运行结果如下:
Compiling: F:\C++\1\1.cpp
Linking console executable: F:\C++\1\1.exe
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Checking for existence: F:\C++\1\1.exe
Executing: D:\Program Files\CodeBlocks/cb_console_runner.exe "F:\C++\1\1.exe" (in F:\C++\1)
Process terminated with status -1073741819 (0 minutes, 4 seconds)追问

我是新手,还是不懂喔,下面的两段英文不太明白

生成前没有显示错误的

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答