Thanks for replying Ancient Dragon. But i have another question, how would you go about for a program reading a keystroke for exmaple the above you posted but in a keystroke so, if a is pressed then do something. Thanks, Clipper34.
Win32: use <conio.h> stuff ([sub]me goes to wash my hands[/sub]) or the Win32 Console Functions to set the input console mode to 0 and read a single key. (Don't forget to restore the console mode to what it was before!) You can WaitForSingleObject() on the input console handle if you want to test for keypresses.
On POSIX systems, you'd also have to set the console mode to unbuffered (or "raw"), but the code to do that is more than I want to type-in right now, so see option 3:
For cross-platform stuff, use the Curses library.
POSIX systems: Linux, Unix, Minix, etc.
(If you are on Unix, chances are it is already installed. If you are on Linux, sudo apt-get ncurses-dev or whatever your equivalent is.)
Ported for Win32, DOS, OS/2, Plan 9, Nintendo DS, etc.
As long as you stay away from stuff like mouse-handling (via curses) and window-resize notifications your curses programs should recompile without difficulty on either platform. Don't forget to link with -lcurses (or if you are on Solaris, -lncurses ).  oh, and on Windows, with -lpdcurses . [/edit]
I just posted a short example on curses here (another forum, alas. Sooner or later I'm going to post a comprehensive "How to <X> the console" tutorial).