fflush
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
If the file associated with <stream> is open for output, the
fflush function flushes the buffer associated with <stream>; the
buffer contents are written to the file. If the file associated
with <stream> is open for input, fflush clears the buffer. The
fflush function negates the effect of any prior call to ungetc
against <stream>.
Buffers are automatically flushed when they are full, when the
stream is closed, or when a program terminates normally without
closing the stream.
The stream remains open after the call. The fflush function has no
effect on an unbuffered stream.
Return Value
The fflush function returns 0 if the buffer was successfully
flushed. The value 0 is also returned when the specified stream
has no buffer or is open for reading only. A return value of EOF
indicates an error.
-♦-