+ 10

User Input Time-out (?)

Greetings everyone! As per title description, I would like to know if there is a way for the program to interpret and time-out a user input. For example, since the program awaits user input when 'cin' is utilised in our codes, is it possible for the program to carry forwards with its process, say, after 20 seconds if no input was detected? I have done some browsing but did not come to much conclusion. I would appreciate if some of you can clear my doubts on this issue. Regards, Hatsy Rei.

1st Jan 2017, 11:16 AM
Hatsy Rei
Hatsy Rei - avatar
2 Antworten
+ 4
Although multi threading comes to mind first, but I think its possible without it Try: http://stackoverflow.com/questions/13541018/c-game-countdown-timer Do post here if it works! Im interested too! :) P.S: Highly doubt codeplayground can handle things like these
1st Jan 2017, 1:34 PM
Vishal++
Vishal++ - avatar
+ 6
Thanks for the feedback! I'll update once I've tested it.
1st Jan 2017, 1:36 PM
Hatsy Rei
Hatsy Rei - avatar