I want to use input y to do saving thing,and r to do resuming, but then i write it in the following codes,and then I input y or r,I just to be noticed ""Please enter two positve numbers" this line code "if(x==(int)('y'))"and next line is ignored.how could this happen
int main(){
cout<<"It's player_"<<player+1<<"'s turn please input a row and col,to save and exit,input y,resume game input r"<<endl;
while(true){
cin>>x;
if(x==(int)('y')) {save();has_saved=true;break;}
if(x==(int)('r')) {resume();has_resumed=true;break;}
cin>>y;
if(cin.fail()){
cout<<"Please enter two positve numbers"<<endl;
cin.clear();
cin.sync();}
else {
chessboard[x][y]=player_symbol[player+1];
break;
}
}
}