Quote:Original post by fuchu//your code goes below...system("PAUSE");...
Sourt of standard, but easily hackable, especially on linux, and not all os's have the same name for their pause function.
Quote:Original post by fuchu//your code goes below...system("PAUSE");...
Quote:Original post by fuchu
I will start using my_pause(); because I want to make a game compatible for Windows, MasOS, and Linux.
void my_pause(){ cout<<"Press [ENTER] to continue."<<endl; cin.get(); //This extra cin.get() will take the input from the buffer (if there is any) cin.get(); //...and this will wait for new input.}/**************************************************/void my_pause(){ cout<<"Press [ENTER] to continue."<<endl; fflush(STDIN); //Clears stdin, which in this case is the keyboard. cin.get();}/**************************************************/void my_pause(){ cout<<"Press [ENTER] to continue."<<endl; cin.ignore(255, '\n'); //Reads and discard all characters until it finds a newline. cin.get();}