|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <stdio.h> int fflush(FILE *file);
If file is not a
NULL pointer, this function causes any
unwritten buffered data to be written out to the given file. This
is useful in cases where the output is line buffered and you want to
write a partial line.
If file is a
fflush writes any
buffered output to all files opened for output.
fflush has no effect for streams opened for reading
only. Also note that the operating system can further buffer/cache
writes to disk files; a call to
fsync (see section fsync) or
sync (see section sync) is typically required to actually deliver
data to the file(s).
Zero on success, -1 on error. When called with a
-1 will be returned if an error happened while flushing some of the
fflush will still try to flush all the rest before
|ANSI/ISO C||C89; C99|
printf("Enter value : "); fflush(stdout); scanf(result);
|webmaster||delorie software privacy|
|Copyright © 2004 by DJ Delorie||Updated Apr 2004|