Mail Archives: djgpp/1997/02/17/22:42:39
Stephen Lyda wrote:
>
> Basically, I am trying to cause getchar() to work correctly, returning
> after a single key is pressed, and not waiting until the buffer is
> full or a CR is encountered.
It simply isn't possible. There is no way to shut off line buffering
for text input streams because of the way DOS works. If you want to get
a character at a time (or perform other character-style operations), use
the <conio.h> functions, such as getch(). Of course, the conio
functions read directly from the BIOS keyboard handler, so they can't be
redirected like stdin or stdout.
For a complete list of conio functions, install the 'v2gnu/txi390b.zip'
package and type the following words of wisdom:
info libc func conio
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| * Proud user of DJGPP! * | http://www.cs.com/fighteer |
| ObJoke: If Bill Gates were a robber, not only would he |
| shoot you, but he'd send you a bill for the bullets. |
---------------------------------------------------------------------
- Raw text -