FILE 在stdio.h中的定义如下 :
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;
fopen() 返回了个 FILE 指针
定义FILE 指针是应该初始化为空(NULL)
使用完后应该使用fclose()函数来释放,防止内存泄露 并把文件指针赋值为NULL
例如:FILE *pfile = NULL;
..............................
fclose(pfile);
pfile = NULL;