Re: non-delay mode read from cin

From: Arijit (pal_ari_at_yahoo.co.in)
Date: 11/01/04


Date: 31 Oct 2004 20:31:04 -0800


"richard" <byang1@sbcglobal.net> wrote in message news:<pan.2004.10.31.18.51.00.62900@sbcglobal.net>...
> I am trying to do non-delay mode read from cin, i.e.
> char ch;
> ...
> while( cin.getch(ch) )
> {
> ...
> }
> I want getch to return whenever there is a char typed (not wait till
> a newline is seen).
>
> How do I do this? I am using linux if it matters.
>
> thanks,
>
> ----RICH

Not possible in standard C++. Since you are using linux, check out the
GNU readline library.

-Arijit



Relevant Pages

  • non-delay mode read from cin
    ... I am trying to do non-delay mode read from cin, ... I want getch to return whenever there is a char typed (not wait till ... a newline is seen). ...
    (comp.lang.cpp)
  • Re: non-delay mode read from cin
    ... >I am trying to do non-delay mode read from cin, ... > I want getch to return whenever there is a char typed (not wait till ...
    (comp.lang.cpp)
  • Re: about getch()
    ... But the getch() isn't a standard C function ... So what should I to do in Linux? ... program won't find out about character presses by default until the user ... unbuffered mode, then call getchar, then set the terminal back to ...
    (comp.lang.c)
  • Re: getch()
    ... character from the keyboard, but it's not working. ... encounters getch() to accept input from keyboard. ... You /do/ realize that the getchfunction in Linux does not do ... character in the input buffer. ...
    (comp.unix.programmer)
  • Re: about getch()
    ... But the getch() isn't a standard C function ... So what should I to do in Linux? ... This program broke my computer.!!!! ...
    (comp.lang.c)