flushall() Flush All Streams and Clear All Buffers
#include <stdio.h>
int flushall(void);
flushall() works on input and output streams. It writes the contents
of all buffers associated with open output streams to their
associated files. It clears the contents of buffers associated with
open input streams.
Returns: The number of open streams. There is no error return.
Notes: All streams remain open after the call to flushall().
Buffers are automatically flushed when they are full,
when the streams are closed, or when a program terminates
normally.
See fflush() for a similar function that works on a
specified stream.
-------------------------------- Example ---------------------------------
The following statements open two files and flush them both with a
single call to flushall().
#include <stdio.h>
FILE *stream1, *stream2;
main()
{
if ((stream1 = fopen("raw.dta","r")) != NULL &&
(stream2 = fopen("update.dta","a+")) != NULL) {
flushall();
}
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster