Possible Duplicate:
C/C++: Capture characters from standard input without waiting for enter to be pressed
I'm using C-Free 4 Standard on windows 7 and I writing a C program.
I'm using getch() as a function to pause the program, however, the character(s) pressed echos on the screen and it waits for the Enter key to be pressed before moving on (it doesn't look any different than how the scanf works). I tried getche(), and it works fine, although the echo appears.
What could be the problem with the getch() function?
The getch, wgetch, mvgetch and mvwgetch, routines read a character from the window. In no-delay mode, if no input is waiting, the value ERR is returned. In delay mode, the program waits until the system passes text through to the program. Depending on the setting of cbreak, this is after one character (cbreak mode), or after the first newline (nocbreak mode). In half-delay mode, the program waits until a character is typed or the specified timeout has been reached.
More or less the same method is used in Windows. You can use _getch() to get the input character available for the application without buffering.