原网址:http://blog.csdn.net/hgj125073/article/details/8287062
fclose()关闭关闭一个流,注意:使用fclose()函数就可以把缓冲区内最后剩余的数据输出到磁盘文件中,并释放文件指针和有关的缓冲区。
#include<stdio.h>
原型:
int fclose(FILE *stream);
int _fcloseall(void);
fclose returns 0 if the stream is successfully closed._fcloseall returns the total number of streams closed.
The _fcloseall function closes all open streams exceptstdin, stdout, stderr (and, in MS-DOS, _stdaux and _stdprn). It also closes and deletes any temporary files created by tmpfile. In both functions, all buffers associated with the stream are flushed prior to closing.
如果流成功关闭,fclose 返回 0,否则返回EOF(-1)。
如果流为NULL,而且程序可以继续执行,fclose设定error number给EINVAL,并返回EOF。
【FROM MSDN && 百科】