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

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

   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>
   main()
   {
   FILE *fp;
        fp = fopen("file.dta","r");
        if(fp == NULL)
             printf("Datafile not opened\n");
        else
        {
             fclose(fp);
             printf("File file.dta closed using fclose\n");
        }
   }

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


See Also: close fopen freopen

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