On Mon, 12 Sep 2005 18:15:40 -0700, "Dick Bridges"
<db******@codecomplete.com> wrote in comp.lang.c++:
I guess I'm more of a newbie than I'd thought. I simply want to wait for at
least one byte (character?) to appear and then cin.get() or cin.read() that
character - without waiting for some delimiter to appear. I would have
thought this would be a common pattern for event-driven keystroke processing
but I can't find any examples of how it would be done using c++ iostreams.
Can someone point me toward a book, article, or example?
TIA
There is absolutely no standard, portable way of doing this. C++ does
not provide or support keystrokes, all I/O is abstracted into
iostreams or FILE * streams. And in almost every operating system
today, you can start your program from a shell and make sure that its
standard input stream comes from a file or another device and has no
connection at all to a keyboard, assuming the system has one.
You need to ask in a group that specifically supports your compiler/OS
combination to see what sort of platform-specific non-standard
extensions it provides to do this.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html