- 16
- 0
- 约1.27万字
- 约 19页
- 2017-07-05 发布于河南
- 举报
C语言文件操作函数大全(国外英文资料)
C语言文件操作函数大全
First, read and write standard documents
1. file open, fopen ()
The file open operation that will give the user specified file in the memory allocation of a FILE structure, and the structure of the pointer returned to the user program, after the user program is available in this FILE pointer to achieve access to the specified file operation. When using the open function, must give the file name, file operations (read, write or read and write), if the file name does not exist, it means to establish (only to write files to read the file, then the error), and the file pointer to the beginning of the file. If there is already a file with the same name, the file is deleted. If it does not have the same name file, the file is created and the file pointer is pointed at the beginning of the file.
Fopen (char, *filename, char, *type);
Where *filename is the file name pointer to open the file, usually expressed in double quotes, and also can be separated by double slashes. The *type parameter indicates how to open the file. The mode of operation available is as follows:
Mode meaning
R opens, read-only
W opens, the file pointer refers to the end, and only writes
A opens, points to the end of the file, and is appended to the existing file
RB opens a binary file that is read only
WB opens a binary file and writes only
Ab opens a binary file and appends it
R+ opens an existing file in read / write mode
W+ creates a new text file in read / write mode
A+ opens a file file to append by reading / writing
Rb+ opens a binary file in read / write mode
Wb+ creates a new binary file in read / write mode
Ab+ opens a binary file for additional purposes by reading / writing
When fopen (0 successfully opens a file, the function returns a FILE pointer and returns a NULL pointer if the file opens. If you want to open the test file, write it:
FILE *fp;
If ((fp=fopen (test, W)) ==NULL)
{
Printf (File cannot be opened\n);
Exit ();
}
Else
Printf (File opened for writing\n);
......
Fclos
您可能关注的文档
- !!!变压器的要求和技术参数(国外英文资料).doc
- (上卷)重新学会笑--------中国式新森田教...(国外英文资料).doc
- (宁鸣)晨间(国外英文资料).doc
- (四)津液-(国外英文资料).doc
- (新版)高强轻质高温耐火砖生产制造制备及应用工艺专利技术文集(国外英文资料).doc
- (图解)普林斯顿进攻体系(国外英文资料).doc
- (第1章) 单片机教案(国外英文资料).doc
- (考试时间:70分钟 试卷满分:70分 考试形式:开卷)(国外英文资料).doc
- - 上海LNG加气站 上海CNG加气站博客上海LNG加气站 上海CNG加气站博客(国外英文资料).doc
- ...我相信能耐耐心心看完文章的人,不用再对手机这东西纠结了_百度文库...(国外英文资料).doc
最近下载
- 高压电缆中间头制作措施方案.pdf
- 内容文本分析案例dcc500c机.pdf VIP
- 数学(天津卷02)-2024年高考押题预测卷(全解全析).docx VIP
- 2026年黑龙江林业职业技术学院单招职业适应性测试题库附答案.docx VIP
- 2023年高考押题预测卷02(天津卷)-英语(全解全析).docx VIP
- 2023年高考押题预测卷01(天津卷)-英语(全解全析).docx VIP
- 2024年高考英语临考押题卷01(天津卷)(全解全析).docx VIP
- 高中美术《美术鉴赏》 第一课《培养审美的眼睛——美术鉴赏及其意义》课件共55张.ppt VIP
- 申菱组合式空气处理机组.pdf
- 2024年高考英语临考押题卷02(天津卷)(全解全析) .docx VIP
原创力文档

文档评论(0)