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
Beginners
Getting input without cin ?
Getting input without cin ?
Jun 4, 2013 at 5:24pm
Jun 4, 2013 at 5:24pm UTC
DrZoidberg
(143)
Is there a similar command that does not pause for the user to enter information? For example if I wanted to break a loop when a user presses the 'x' key, how would I do that?
Jun 5, 2013 at 1:08pm
Jun 5, 2013 at 1:08pm UTC
DrZoidberg
(143)
bump
Jun 5, 2013 at 2:09pm
Jun 5, 2013 at 2:09pm UTC
coder777
(8449)
unfortunately there's no standard solution.
For windows you might use _kbhit():
http://msdn.microsoft.com/en-US/library/58w7c94c%28v=vs.80%29.aspx
Jun 5, 2013 at 2:26pm
Jun 5, 2013 at 2:26pm UTC
andywestken
(4094)
You'll also need _getch
_getch, _getwch
http://msdn.microsoft.com/en-US/library/078sfkak%28v=vs.80%29.aspx
Andy
Last edited on
Jun 5, 2013 at 2:26pm
Jun 5, 2013 at 2:26pm UTC
Jun 5, 2013 at 4:38pm
Jun 5, 2013 at 4:38pm UTC
DrZoidberg
(143)
Thank you coder777 and Andy, solved my problem!
Topic archived. No new replies allowed.