i want to make a program that pint's number from 1-100 continuously until any input is given, so i thought if only there was a time limit in which user can give input. Like if the user fails to enter an input in that time then programs skips to next step, it will make it look mare natural rather than asking for input in each step.
Asked
Active
Viewed 71 times
0
-
1This is what threading is for. Once thread displays while the other waits for user input. – NathanOliver Mar 16 '18 at 18:46
-
[Interrupt `std::cin`](https://stackoverflow.com/q/24976180/1460794) – wally Mar 16 '18 at 18:47
-
[Stop `std::cin` from another thread.](https://stackoverflow.com/q/42395777/1460794) – wally Mar 16 '18 at 18:49
-
How do you plan on accepting the user input? – wally Mar 16 '18 at 18:51
-
using cin, because i only want an char, and if the input is true he program stops – Tarun Jha Mar 16 '18 at 19:25
-
`std::cin` will not work well for this. Rather use the [operating system's input functions](https://stackoverflow.com/a/2441480/1460794). – wally Mar 16 '18 at 20:06