Mail Archives: djgpp/1998/12/07/10:58:09
On Mon, 7 Dec 1998, Phillip Rhodes wrote:
> in other words, I want to do something that creates the effect of
> getch(), reading a keystroke, without having to wait for
> ENTER to be pressed.
You need to switch stdin to binary mode. Sorry, I don't know how to do
that exactly in C++.
Keep in mind that binary I/O from stdin, at least in DJGPP, has several
side effects that you should consider. For example, ^Z no more signals
EOF, ^C doesn't interrupt the program, etc. For a full description of
these and other issues, and how to work around them, check out the
description of the library function `setmode' in libc.inf library
reference.
- Raw text -