non-delay mode read from cin

From: richard (byang1_at_sbcglobal.net)
Date: 10/31/04


Date: Sun, 31 Oct 2004 17:50:57 GMT

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



Relevant Pages

  • 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 ... I am using linux if it matters. ...
    (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)
  • cin is eating my output
    ... I have found to get the first line to appear is to put a newline at ... Despite the exception cin is still waiting for its input. ... I pass some text to cout for output. ...
    (comp.lang.cpp)
  • Re: using default values on <Enter> with no input
    ... but as newline is entered. ... how to get cin to work if there isn't any actual input. ... I think you want to look at getline. ... Put the input into a string object and either parse it manually or you ...
    (comp.lang.cpp)
  • std::cin.ignore() and std::cin.clear()
    ... This will read s1 from cin until it finds a space (or a newline, ... whichever comes first). ... Okay this works. ...
    (comp.lang.cpp)