I have two questions regarding program below.
1) Since ch is just an integer, where do all characters I enter after first one get saved? Let's say I enter abcdefg. 'a' will be stored at ch location. 'b' will then overwrite 'a', 'c' overwrites 'b', and so on. Where are those characters saved in order to not getting overwritten?

2)How can I modify this program so characters show on the screen as soon as I enter them?

Code:
#include <stdio.h>

int main (void)
{
 int ch;

 while ((ch = getchar ()) != EOF)
  putchar (ch);

 return 0;
}
Thx !