Mail Archives: djgpp/1998/12/08/14:05:55
Nathaniel Johnson wrote:
> if you just want to get a key when it is hit without using <ENTER> just
> use this code
>
> int c = 0;
> while (c != 27) // until you hit <ESC>
> {
> if (kbhit())
> {
> c = getch();
> printf("The key you hit is %d", c); // ex: if you hit A then c = 65
> }
> }
Thanks, but I'm trying to do it in C++, using the C++ Iostream library. I
want to avoid the old C style io routines. What you showed above though,
is exactly the effect I want, I just need a way to do it in C++, using
iostreams.
TTYL,
Phil
- Raw text -