Hello, i'm a fairly new programmer, and i've recently encountered a problem. How would i be able to set a timer for reading input from a user, as simply as possible?
eg.
touser - "Enter a password: " (i've been using printf here)
input
if timer exceeds 5000 miliseconds, then...
touser - "You took too long!" (again, printf)
Now, i have a timer function that works fine, but my problem is checking the timer function WHILE waiting for input...the program waits for input to be entered BEFORE it checks to see if the "5000 miliseconds" are up. I've tried scanf, and gets...if you can help, i'd be much obliged.
Thanks,
Rob
eg.
touser - "Enter a password: " (i've been using printf here)
input
if timer exceeds 5000 miliseconds, then...
touser - "You took too long!" (again, printf)
Now, i have a timer function that works fine, but my problem is checking the timer function WHILE waiting for input...the program waits for input to be entered BEFORE it checks to see if the "5000 miliseconds" are up. I've tried scanf, and gets...if you can help, i'd be much obliged.
Thanks,
Rob