For the sake of education, and programming practice, I\'d like to write a simple library that can handle raw keyboard input, and output to the terminal in \'real time\'.
This is not possible using only standard ISO C. However, you can try using the following:
#include void setbuf(FILE * restrict stream, char * restrict buf);
and related functions.
Your best bet though is to use the ncurses library.
ncurses