#include <iostream>
using namespace std;
enum GameResult{WIN,LOSE,TIE,CANCEL};
int main()
{
GameResult result;
enum GameResult omit=CANCEL;
for(int count=WIN; count<=CANCEL;count++){
result=GameResult(count);
if(result==omit)
cout<<"The game was cancelled"<<endl;
else{
cout<<"The game was played";
if(result==WIN)
cout<<" and we won!";
if(result==LOSE)
cout<<" and we lost.";
cout<<endl;
}
}
return 0;
}
编译可以通过没有错误提示 ,但是输入后无反应,也没有弹出窗口
debug后
由于反复调试,发现这个警告并不是程序本身引起的,网上有很多人也出现了这种问题,关于GDB在设置控制终端时造成的,完全是由于调试器引起的,但是qtcreator使用的调试器依然是GDB,只不过对于我们程序员来说可视化而已,需要升级系统解决