Press any key to continue

Jun 6, 2011 at 10:03pm
with the popular cin.get()
and the treacherous system("pause")
you have to press enter to continue. But a while back I found a line that was cin.(something). It would accept any key as 'continue program'. Does anyone know what that was?
Jun 7, 2011 at 2:32am
closed account (S6k9GNh0)
There is nothing in the standard stream classes that does this. This was most likely part of the IDE that you used. The a viable option is then:

1
2
std::cout << "Press any key to continue..."
std::cin.ignore();
Last edited on Jun 7, 2011 at 2:33am
Topic archived. No new replies allowed.