Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - fcloseall http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   fcloseall
   Usage
   #include <stdio.h>
   int fcloseall();

   Description
   fcloseall  closes all open streams/files except stdin and stdout.  Any
   data in the I/O buffers is flushed before closing.

   Example
   #include <stdio.h>
   main()
   {
   int x;
   FILE *fp1, *fp2;

        fp1 = fopen("file1.dta","r");
        if(fp1 == NULL)
        {
             printf("Datafile not opened\n");
             exit(1);
        }
        fp2 = fopen("file2.dta","r");
        if(fp2 == NULL)
        {
             printf("Datafile not opened\n");
             exit(1);
        }
        x = fcloseall();
        printf("fcloseall closed %d streams\n",x);
   }

   Return Value
   fcloseall returns the number of streams closed.


See Also: close fclose fopen freopen

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