Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>flushall() flush all streams and clear all buffers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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();
              }
          }

See Also: fflush()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson