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 6.0 - <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; no error return.

      Notes:    All streams remain open after the call to flushall().

                Flushing occurs automatically when a buffer is full, when
                a stream is closed, or when a program terminates
                normally.

                See fflush() for a similar function that works on a
                specified stream.

 Portability:   Applies to MS DOS only.

   -------------------------------- Example ---------------------------------

    The following statements open two files and flush buffers for 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