| [ < ] | [ > ] | [ << ] | [ 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 NULL pointer, fflush writes any
buffered output to all files opened for output.
Note that 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 NULL pointer,
-1 will be returned if an error happened while flushing some of the
streams (but fflush will still try to flush all the rest before
it returns).
| ANSI/ISO C | C89; C99 |
| POSIX | 1003.2-1992; 1003.1-2001 |
printf("Enter value : ");
fflush(stdout);
scanf(result);
|