In the next code:
#include int main(void) { int c; while ((c=getchar())!= EOF) putchar(c); return 0; }
By default, the C library buffers the output until it sees a return. To print out the results immediately, use fflush:
fflush
while((c=getchar())!= EOF) { putchar(c); fflush(stdout); }