【转】C语言fclose函数了解
2015-12-02 16:01
387 查看
原网址: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 && 百科】
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 && 百科】
相关文章推荐
- C/C++跨平台的的预编译宏
- 讲解C语言编程中指针赋值的入门实例
- MFC更改控件ID后,cpp文件显示错误“未定义的标识符”
- C语言中变量与其内存地址对应的入门知识简单讲解
- C++的动态库和静态库
- 【转】C++中delete和delete[]的区别
- C语言数组入门之数组的声明与二维数组的模拟
- C++ md5 小32位加密 (含源码下载)
- qt c++11 thread 执行错误
- C语言的数组学习入门之对数组初始化的操作
- 简单LRU算法实现的Cache(C++)
- C语言中sizeof()与strlen()函数的使用入门及对比
- C++11 JNI开发中RAII的应用(一)--制作基础工具
- C语言_数组与指针
- C语言_倒序输出
- C++连接mysql数据库
- C++终极复习篇(四)----封装继承多态
- C语言之转义字符
- c语言版——四则运算
- 【哈工大C语言作业实验题】:13-2作业