When i use system("pause"), then a line "Press any key to continue..." shows up on the screen.
This is iritating and makes reading the output quite cumbersome.
Is there some way to stop this from coming?
Do you mean that you want to press any key to continue but not to display the "Press any key to continue" on the screen? Try this getchar();
this will capture one character typing from keyboard and continue.
Rather than using platform dependent system("pause")
you can use the platform independent std::cin.get()
and if the buffer is messing with it, you can use:
std::cin.ignore(std::numeric_limits<std::streamsize>::max(),'\n')
before hand to clear the buffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With