What programming language are you talking about? C/C++?
In my MSVC I can find
getc
getchar
_getch
getc and getch are standard library functions and should be found in any C/C++ implementation.
_getch is a platform implementation function (denoted by the _ at the start of the name), a function provide by the platform in question to support the rest of the c standard library.
The closest standard library equivilent to _getch is getchar.
Put the following text in to Gedit and save as getch.h
to use the function use mygetch()
works like a charm
/
#include <termios.h>
#include <unistd.h>
int mygetch(void)
{
struct termios oldt,
newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}
/solution provided by kermi3 from this web posting http://cboard.cprogramming.com/archive/index.php/t-27714.html