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++ 3.0r4 - <b>fcloseall</b> 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>
   #include <stdlib.h>
   int main()
   {
       int x;
       FILE *fp1, *fp2;
       fp1 = fopen("file1.dta","r");
       if (fp1 == NULL)
           {
           printf("Datafile not opened\n");
           exit(EXIT_FAILURE);
           }
       fp2 = fopen("file2.dta","r");
       if (fp2 == NULL)

           {
           printf("Datafile not opened\n");
           exit(EXIT_FAILURE);
           }
       x = fcloseall();
       printf("fcloseall closed %d streams\n",x);
       return EXIT_SUCCESS;
   }

Return Value

   fcloseall returns the number of streams closed.

See Also

   close, fclose, fopen, freopen



See Also: close fclose fopen freopen

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