fclose function

Prototype int fclose (FILE * Stream);
PurposeTo close a file stream.
Header File#include <stdio.h>
Parameters
StreamPointer to an open FILE
Return Value
0Success
EOFFailure
Notes
  • All buffers associated with the FILE are flushed before the stream is flushed.
Example #include <stdio.h> #include <errno.h> . . . FILE * Account_Master; int Status; . . . Status = fclose (Account_Master); if (Status == 0) printf ("File was successfully closed"); else printf ("Function fclose failed."); }
Related functions
fopen fread fwrite fseek rewind ftell

c/c++ Index