cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
Press any key to continue
Press any key to continue
Jun 6, 2011 at 10:03pm
Jun 6, 2011 at 10:03pm UTC
thenewguy
(140)
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
Jun 7, 2011 at 2:32am UTC
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
Jun 7, 2011 at 2:33am UTC
Topic archived. No new replies allowed.