_flushall

Description

Flushes all streams; clears all buffers.

#include <stdio.h>

int _flushall( void );

Remarks

The _flushall function writes to its associated files the contents of all buffers associated with open output streams. All buffers associated with open input streams are cleared of their current contents. The next read operation (if there is one) then reads new data from the input files into the buffers.

Buffers are automatically flushed when they are full, when streams are closed, or when a program terminates normally without closing streams.

All streams remain open after the call to _flushall.

Return Value

The _flushall function returns the number of open streams (input and output). There is no error return.

Compatibility

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:DOS32X

See Also

fflush

Example

/* FLUSHALL.C: This program uses _flushall to flush all open buffers. */

#include <stdio.h>

void main( void )

{

int numflushed;

numflushed = _flushall();

printf( "There were %d streams flushed\n", numflushed );

}

Output

There were 3 streams flushed