[C++] Timer WHILE waiting for input

Discussion in 'C++' started by Mike Wahler, Jul 29, 2003.

  1. Mike Wahler

    Mike Wahler Guest

    Poof <> 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
    Mike Wahler, Jul 29, 2003
    #1
    1. Advertising

  2. Mike Wahler

    Poof Guest

    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?
    Poof, Jul 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    700
    Kelsang Wangchuk
    Jul 31, 2003
  2. Replies:
    1
    Views:
    1,563
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  3. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,167
    Bruce Barker
    Nov 4, 2005
  4. Alessandro Giambruno

    Waiting until timer without cpu crash?

    Alessandro Giambruno, Jun 18, 2004, in forum: Java
    Replies:
    9
    Views:
    2,882
    Roedy Green
    Jun 22, 2004
  5. Jule Nissen
    Replies:
    5
    Views:
    219
    Glen Holcomb
    Sep 21, 2009
Loading...

Share This Page