Buffering
Characters that are written to a stream are normally accumulated and transmitted asynchronously to the file in a block, instead of appearing as soon as they are output by the application program. Flushing output on a buffered stream means transmitting all accumulated characters. There are many circumstances when buffered output on a stream is flushed automatically:
exit
.If you want to flush the buffered output at another time, call fflush
, which is declared in the header file stdio.h.
LINKS