I press Q key or ESC but the while loop keeps repeating the switchCode:char input; while (input != 113 || input != 27){ //Ask for user input cin >> input; switch (input){ case 113: //(Q key) cout << "startGame "; break; case 27: //(ESC key) cout << "exitGame "; break; default: cout << "default "; break; } //switch (input) ends } //while (input != Q || input != ESC) ends cout << "out" << endl;
I really have no idea whats going on