Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

countdown

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
How can I do a program that ask:
"continue? (y/n)"
And if the user doesn't choose y or n in 3 seconds, the program continues?
Thank you
Rolf
 
How you do this depends you your environment (OS and compiler). If you're using MS-DOS, see if your compiler supports kbhit(), if you're using *nix, you can do it with select() or poll(). A recent thread called "Key press w/o return" (go back a page) discusses ways to "poll" stdin() for input without blocking program execution, which is what you need to do here.

Russ
bobbitts@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top