On Sat, Jul 02, 2011 at 05:32:38PM +0100, Dirk Koopman wrote:
> But how come I get output at a shell prompt, and not down a pipe (or
> a redirection either)? What special magic is occurring here?

If:

1. isatty() is true on the underlying fd of the FILE*

and:

2. The string contains \n

then printf calls fflush().

In your first instance, stdout was your terminal, and in the second it
was one end of a pipe.

Reply via email to