IIRC stdout is buffered by default and stderr is not.

Barry Lake wrote:
>
> At 3:16 AM -0600 11/21/00, Dennis Handly wrote:
> >Barry Lake ([log in to unmask]) wrote:
> >: is to change all printf("whatever") calls to fprintf(stdout, "whatever").
> >: This seems to force the output to be written immediately...
> >
> >Did you mean stderr?  Otherwise they should be the same.
>
> You know, I usually do code things with fprintf(stderr,...).
> However, when I was replying to the original post, I whipped out a quick
> "Hello World" program to verify that what I was going to post would be
> correct. In that program I guess I spaced and used fprintf(stdout,...),
> which seemed to work, so that's what I posted. Is there really a functional
> difference between stdout and stderr? (I know about ">" and "2>"
> redirection in shell scripts, but this started as an MPE programming
> problem, I think.) Isn't buffering handled the same way for stdout and
> stderr?