On unix / posix, the standard way to do this is to enter non-canonical mode using tcsetattr:
#include <termios.h>
#include <unistd.h>
:
struct termios attr;
tcgetattr(0, &attr);
attr.c_lflag &= ~ICANON;
tcsetattr(0, TCSANOW, &attr);
See the termios (3) man page for more details (and probably more information than you would like to know).
source
share