Re: basic i/o question

From: Leor Zolman (leor_at_bdsoft.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 17:21:04 GMT

On Wed, 31 Mar 2004 19:08:55 +0200, Donald Davidson <stys@planet.nl> wrote:

>Is it possible to display a timer counting down while at the same time
>waiting for user input?
>
>With things like cin the whole program more or less comes to a halt.
>
>Or is this already an os/platform related question?

'Fraid it is. There aint a whole heck of a lot that Standard C or C++ let
you do while waiting for input...except keep waiting.

You'd at the very least need a way to poll the input for the existence of
pending characters, and that /alone/ is outside the scope of the Standards.

You could get by without that by using multi-threading or a windowing
system, but those are also platform-specific extensions.
        -leor

>
>Thanks, Donald.

-- 
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix  
C++ users: Download BD Software's free STL Error Message Decryptor at:
   www.bdsoft.com/tools/stlfilt.html


Relevant Pages

  • Re: Sangband spontaneous exits
    ... waiting for user input. ... It's probably the loop that waits for a key at the reader's prompt ... I have never observed this "spontaneous clean exit" ...
    (rec.games.roguelike.angband)
  • Re: Newbie to VB: to what degree is VB event driven [follow up questions]
    ... I understand that the system is not fully dormant while it is waiting ... is it so that (regardless of programming language) the Windows ... environment is what provides a way to eliminate loops to wait for user ...
    (microsoft.public.vb.general.discussion)
  • Re: Opening CHM files over network
    ... | That's exactly what I did per the KB instructions, startup script still hangs ... When I run the batch file in the UI, ... | executes great, no problems, no waiting for user input. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: How to obtain a interactive session of a script?
    ... > This method works fine with only one minor problem. ... > (waiting for user input) at helpcommand. ...
    (comp.lang.python)
  • Re: basic i/o question
    ... > Is it possible to display a timer counting down while at the same time ... > waiting for user input? ... Not with standard C or C++. ...
    (alt.comp.lang.learn.c-cpp)