_flushall (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Flushes all streams; clears all buffers.

int _flushall(    void );

Return Values

_flushall returns the number of open streams (input and output).

There is no error return.

Remarks

By default, the _flushall function writes to appropriate files the contents of all buffers associated with open output streams.

All buffers associated with open input streams are cleared of their current contents.

These buffers are normally maintained by the OS, which determines the optimal time to write the data to disk: when a buffer is full, when a stream is closed, or when a program terminates normally without closing streams.

If a read follows a call to _flushall, new data is read from the input files into the buffers.

All streams remain open after the call to _flushall.

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

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

fclose | fflush

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.