box-o-sand/gowrikumar/03c-stdoutbuf.c
2011-06-16 21:33:57 -04:00

25 lines
405 B
C

/**
* :author: Dan Buch (daniel.buch@gmail.com)
*/
#include <stdio.h>
#include <unistd.h>
int main()
{
printf("This time we'll flush stdout!\n");
printf("(Hit ^C to stop the madness.)\n");
while(1)
{
fprintf(stdout, "hello-out ");
fprintf(stderr, "hello-err ");
fflush(stdout);
sleep(1);
}
return 0;
}
/* vim:filetype=c:fileencoding=utf-8
*/