From 90e101db98c948b9ff905351ac499843a8c7a5c3 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 16 Jun 2011 21:29:28 -0400 Subject: [PATCH] exercise 3 --- .gitignore | 1 + gowrikumar/03-stdoutbuf.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gowrikumar/03-stdoutbuf.c diff --git a/.gitignore b/.gitignore index 841658b..ba46549 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ gowrikumar/00-sizeof gowrikumar/02-dowhile +gowrikumar/03-stdoutbuf diff --git a/gowrikumar/03-stdoutbuf.c b/gowrikumar/03-stdoutbuf.c new file mode 100644 index 0000000..4cf1fb1 --- /dev/null +++ b/gowrikumar/03-stdoutbuf.c @@ -0,0 +1,22 @@ +/** + * :author: Dan Buch (daniel.buch@gmail.com) + */ + +#include +#include + +int main() +{ + printf("(Hit ^C to stop the madness.)\n"); + while(1) + { + fprintf(stdout, "hello-out "); + fprintf(stderr, "hello-err "); + sleep(1); + } + return 0; +} + + +/* vim:filetype=c:fileencoding=utf-8 + */