#include <stdio.h>
/***********************
*name:fclose.c
*author:QG
*time:2015-05-12
*description:
************************/
int main()
{
FILE *fp;
char *file_name = "./123.txt";
int a = 1;
char c_buf[10];
fp = fopen(file_name,"w+");
fread(c_buf,1,10,fp);
printf("read content:%s!\n",c_buf);
a = fclose(fp);
if(a == 0)
{
printf("close file is OK ,a = %d!\n",a);
}
else if(a == EOF)
{
printf("close fail!\n");
}
return 0;
}