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>fclose</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
fclose

Usage

   #include <stdio.h>
   int fclose(FILE *fp);

   ANSI

Description

   fclose closes the file associated with the stream fp. Any data in the
   output buffer for fp is flushed (written to the file) before closing.

Example 

   #include <stdio.h>
   #include <stdlib.h>

   int main()
   {
       FILE *fp;
       fp = fopen("file.dta","r");
       if (fp == NULL) {
           printf("Datafile not opened\n");
           return EXIT_FAILURE;
       }
       else
           {
               fclose(fp);
               printf("File file.dta closed using fclose\n");
           }
       return EXIT_SUCCESS;

   }

Return Value

   fclose returns 0 if the stream successfully closed. A -1 is returned on
   error.

See Also

   close, fopen, freopen



See Also: close fopen freopen

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