C语言文件操作总结

File manipulation function

File on / off

FILE, *infile, =fopen ("ride? in〃,〃W〃);

Fclose (inf订e);

File read:

Fgetc:

Format: int fgetc (FILE ^stream);

Reads a character from the file pointing to the file pointer stream?

The return value of this function is a byte that returns the read. Returns EOF (-1) if it is read at the end of the file or when the error is read.

Fgets:

The prototype is char *f gets (char, *s, int, N, FILE, * stream);

Parameter:

*s: character pointer to the data address that will be stored.

N: integer data, which reads n - 1 characters from the stream.

^stream: pointer data, the stream to read.

Function:

Read nT characters from the file pointer stream, save in the space where s is the starting address, until you have completed a row, and if successful, return the pointer to s, or else return NULL.

Fscanf:

Function name: fscanf

Function: performs formatted input from a stream, fscanf ends with spaces and line breaks, and ends with spaces? This is different from fgets, where fgets encounters spaces that do not end.

Usage: int, fscanf (FILE, ^stream, char, ^format,

[argument ,???);

Int fscanf (file pointer, format string, input list);

Example:fscanf (FP,%s%d%lf, a, &b, &c)

Return value: integer, value equal to the number of [argument??? _

Fread:

Function prototypes: size_t, FREAD (void, ^buffer, size_t, size, size_t, count, FILE, ^stream);

Function: read data from a file stream, read count elements, each element size bytes? If the call succeeds, return count?? If the call is successful, the actual read size*count bytes are read

Parameter:

Buffer: is used to receive data memory addresses, at least size*count bytes in size

Size: the size of a single element, in bytes

The number of count: elements, each of which is size bytes? Stream: input stream

Return value: the number of elements actually read. If the return value is not the same as count (not count*size), the end or error of the file may occur

Gets the error information from f err or and f

c语言实验报告《文件操作》,c语言文件操作总结.docx相关推荐

  1. 大一C语言实验报告九江学院,九江学院C语言实验报告及答案-资源下载人人文库网...

    九江学院 C语言实验报告及答案 高级语言程序设计实验指导学 院:信息科学与技术学院专 业:信息管理与信息系统 学 期:20112012学年第二学期教 师: 目录实验1 熟悉C语言程序开发环境11.1 ...

  2. C语言实验报告册-20163a,C语言实验报告册20163a-资源下载人人文库网

    C语言实验报告册 20163a 金陂科扶暑院学生实验报告册(理工类)课程名称:C语言程序设计实验 专业班级:15自动化2班学生学号:1517011063学生姓名: 王启涛所属院部:智能科学与控制工程学 ...

  3. C语言实验报告计算成绩,c语言实验报告--学生成绩管理系统.doc

    c语言实验报告--学生成绩管理系统.doc XX大学CSUC语言程序设计实践报告题目学生成绩管理系统学生姓名剽悍的小白兔指导教师TZ学院信息科学与工程学院专业班级电气信息类XXXX班完成时间20XX年 ...

  4. c语言实验报告熟悉vc,C语言实验报告源代码

    C语言实验报告源代码 1.问题描述:计算三个整数12*34*56的积,得出正确的结果,并能通过此实验熟悉vc6.0的操作环境: 源程序及注释: # include void main() /*求三个数 ...

  5. C语言实验报告册-20163a,c语言实验报告册-20163a.doc

    c语言实验报告册-20163a.doc 学生实验报告册(理工类)课程名称:C语言程序设计实验专业班级:15自动化2班学生学号:1517011063学生姓名:王启涛所属院部:智能科学与控制工程学院指导教 ...

  6. c语言实验报告5数组,c语言实验报告五一维数组.doc

    c语言实验报告五一维数组 <C程序设计>课程实验报告 学院: 班级: 姓名: 学号: 实验设备:计算机1台2011年3月1日 实验项目名称一维数组 掌握一维数组的定义.初始化,以及一维数组 ...

  7. 类c语言实验报告,内蒙古工业大学 C语言实验报告

    <内蒙古工业大学 C语言实验报告>由会员分享,可在线阅读,更多相关<内蒙古工业大学 C语言实验报告(10页珍藏版)>请在人人文库网上搜索. 1.内蒙古工业大学信息工程学院内蒙古 ...

  8. C语言实验报告二模板,C语言实验报告模板

    left=m; }else if(a[m]>num) { right=m; } else { printf(\的位置是%d\\n\ break; } Step13:考虑到不合法的问题if(lef ...

  9. c语言实验报告课程名称,c语言实验报告

    课程名称编程基本实验项目名称实验1简单的C语言编程实验时间*实验类型□可操作性?验证□可设计性□综合指导员***实验地点***(包括机器编号)实验日期****年**月**天学生姓名***班级***** ...

  10. C语言实验报告4云南大学,C语言循环结构程序设计实验报告.doc

    C语言循环结构程序设计实验报告.doc 云南大学数学与统计学实验教学中心实验报告课程名称程序设计和算法语言学期 20122013学年下学期成绩指导教师学生姓名学生学号实验名称循环结构程序设计实验编号四 ...

最新文章

  1. form实现登陆操作
  2. Redis主从+KeepAlived实现高可用
  3. 偏差、方差、欠拟合、过拟合、学习曲线
  4. C/C++中善用大括号
  5. perl anyevent socket监控web日志server
  6. 解决IE8上传文件时javascript取文件的本地路径的问题C:\fakepath\..
  7. C++ STL学习笔记(2) 容器结构与分类
  8. 【104】Maven3.5.0结合eclipse使用,提示Lambda expressions are allowed only at source level 1.8 or above错误的解决方法
  9. Python 崛起、JavaScript 制霸 —— GitHub 2017 年度开源报告里的语言之争
  10. go set up on ubuntu
  11. 「14」支持向量机——我话说完,谁支持?谁反对?
  12. 简单数字电压表的c语言程序,简易数字直流电压表电路及程序
  13. 火狐浏览器添加restclient.xpi 添加插件时候遇见的 附件未经验证无法安装
  14. UBI文件系统的制作与挂载案例
  15. Thumbnails压缩图片
  16. 二分+贪心——HDU 5855
  17. Cisco配置发送日志到日志服务器
  18. 技术总监/技术leader 职责与工作记录 第一天
  19. 模拟鼠标移动程序实现——解决域控制器策略强制电脑锁屏问题
  20. 转行软件测试4年,从初级入门到高级测试,听听他的经验分享

热门文章

  1. Android【Toolbar、DrawerLayout 滑动菜单、 FloatingActionButton 悬浮按钮、Snackbar可交互提示、 Coordinator】
  2. stm32h7关串口中断怎么弄_【STM32H7教程】第33章 STM32H7的定时器应用之TIM1-TIM17的中断实现...
  3. 四川音乐学院计算机音乐创作,四川音乐学院本科录音艺术与计算机音乐_四川音乐学院本科录音艺术与计算机音乐简介-查字典学校网...
  4. 全球与中国战术惯性导航系统市场深度研究分析报告(2021)
  5. ETL数据交换平台,支持多种实时数据流接入
  6. 统计学专业同学需要掌握的数据库基本用法
  7. 计算机数据表示方法及工业标准IEEE754讲解教程
  8. Mac电脑如何重启剪贴板?
  9. Github上传访问令牌申请(Personal access tokens)
  10. 5.38 综合案例2.0 -语音助手(短信,蓝牙,M2M设备间通信)