cplusplus.com > reference > cstdio > fclose |
fclose
<stdio.h> |
cplusplus.com |
Close a stream.
Close the file associated with the specified stream after flushing all
buffers associated with it.
Parameter.
Return Value.
If the stream is successfully closed 0 is returned.
If any error EOF is returned.
Example.
/* fclose example */
#include <stdio.h>
int main ()
{
FILE * pFile;
pFile = fopen ("myfile.txt","wt");
fprintf (pFile, "fclose example");
fclose (pFile);
return 0;
}
See also.
fopen,
freopen,
fflush