What do you mean by "throw stderr"? What is the output from your program, and what are you expecting it to do?

I changed it slightly (while(1) -> for (int i=0; i<5; i++)), built and ran it in Visual Studio 2005 (without the sleep() call either cos I couldn't find where this was displayed) and the output was:
hello-out
hello-err
hello-out
hello-err
hello-out
hello-err
hello-out
hello-err
hello-out
hello-err

- as you see, displaying both hello-out and hello-err.

If you change it from while(1) to a short loop, what is the output then?