File I/O
C fclose
fclose() function is C library function and it’s used to releases the memory stream, opened by fopen() function.
The basic format of fclose is:
Syntax:
int fclose( FILE * stream );
Return Value
C fclose returns EOF in case of failure, and returns 0 on success.
Example:
#include<stdio.h>
int main()
{
FILE *fp;
fp = fopen("fileName.txt","w");
fprintf(fp, "%s", "Sample Texts");
fclose(fp);
return 0;
}
Comments
Post a Comment