Getting input without cin ?

Jun 4, 2013 at 5:24pm
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
bump
Jun 5, 2013 at 2:09pm
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
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 4:38pm
Thank you coder777 and Andy, solved my problem!
Topic archived. No new replies allowed.