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>fcloseall() close all open streams</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 fcloseall()             Close All Open Streams

 #include   <stdio.h>

 int        fcloseall(void);

    fcloseall() closes all open streams except 'stdin', 'stdout',
    'stderr', 'stdaux', and 'stdprn'.  fcloseall() flushes all buffers
    associated with the streams and frees all buffers allocated by the
    system.  fcloseall() will delete temporary files created with
    tmpfile().


    Returns:    The number of streams closed successfully.  EOF is
                returned on error.

      Notes:    Buffers assigned by setbuf() and setvbuf() are not freed
                automatically.

 Portability:   Applies to MS DOS only.

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

    This example opens two streams and closes them both with a single
    call to fcloseall().

           #include <stdio.h>

           FILE *stream1, *stream2;

           main()
           {
               if ((stream1 = fopen("ch1.txt","w+")) != NULL &&
                   (stream2 = fopen("ch2.txt","w+")) != NULL) {
                   .
                   .
                   .
                   fcloseall();
                }
           }


See Also: close() fclose() fflush()

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