By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,778 Members | 1,947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,778 IT Pros & Developers. It's quick & easy.

[C++] Timer WHILE waiting for input

P: n/a
Lets say we're doing a maths quiz program, and each question will be skipped
if the timer expires without any input.

Surfing through the net I see a way to do it with kbhit(), but it limits the
input to just one character, is there anyway to do more complex inputs?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Poof <se******@hotmail.com> wrote in message news:3f27ca88@shknews01...
Lets say we're doing a maths quiz program, and each question will be skipped if the timer expires without any input.
ISO standard C++ (the topic here) does not support
nonblocking input. You'll need a platform-specific
solution.

Surfing through the net I see a way to do it with kbhit(),
This shows why it's not a good idea to depend upon "C++
information" you might find on the web. The large majority
of it is simply wrong. There is no such function 'kbhit()'
in standard C++. Some PC-based compilers do provide such
a function, but each implementation will work in its own
way, and in a platform-specific manner.
but it limits the
input to just one character, is there anyway to do more complex inputs?


There is no way to do nonblocking input in standard C++.

Try a newsgroup about your platform and/or implementation.

-Mike

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.