[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: fork or printf problem

Pratap Chakravarthy forced the electrons to say:
> > Once the buffer is full,
> i dont think like that, because stdio gives three types of buffering
>     1. unbuffered
>     2. line buffered
>     3. fully buffered

Perfectly true. In case 1, a fflush() call is made for every character
written, in 2, after every \n or once the buffer is full, and in 3,
once the buffer is full.

They are by default used in:

unbuffered - for stderr,
line buffered - for stdout to terminals,
and full buffering - for output to files.