I want to freeze the program(until the user presses a key) and I want to put my own message instead of
"Press any key to continue..."
|
std::cin.ignore();//my suggestion
|
is you want the full code do
1 2 3 4
|
void exit(){
std::cout << "Press any key t continue...";
std::cin.ignore();
}
|
this is a little more memory efficient than what shinigami suggested because there is no variable allocation. but both work perfectly well.
Last edited on