clear all input buffers and write all output buffers
#include <stdio.h> int flushall( void );
The flushall() function clears all buffers associated with input streams, and writes any buffers associated with output streams. A subsequent read operation on an input file causes new data to be read from the associated file or device.
Calling the flushall() function is equivalent to calling the fflush() for all open stream files.
The number of open streams. When an output error occurs while writing to a file, the global variable errno is set.
#include <stdio.h> void main() { printf( "The number of open files is %d\n", flushall() ); }
produces output similar to the following:
The number of open files is 4
WATCOM
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |