My C code:
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
Why does this program react like this on inputting
Your terminal probably only writes your input to stdin when you press enter. Try typing something, backspace and write something else; if you don't see the originally typed characters, it means that your terminal was waiting for you to compose the line before sending the data to the program.
If you want raw terminal access (e.g. react to key-down and key-up), you should try some terminal library like ncurses.