- 1、本文档共22页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言文件输入输出函数(C language input output function)
C语言文件输入输出函数(C language input output function)
C language file input and output function - basically all!! The 2007-07-05 10:00:09
Classification: C/C + +
C language input and output functions
1. The fopen () function
The fopen function is used to open the file, and its call format is:
The FILE * fopen (char * filename, * type);
In introducing this function; First, learn the following.
(1) stream and file (file)
Streams and files differ in Turbo C2.0, Turbo C2.0 for programmers and access
The backup provides a layer of abstract things called streams and the actual device is called a file.
Flow is a logical device with the same behavior. Therefore, the function used to write the disk file is also the same
It can be used to write to the printer. There are two types of streams in Turbo C2.0: text flows (text)
Stream) and binary stream. For disks, its text files and binaries. this
Software is designed to make it easy for readers to understand Turbo C2.0 language without any special distinction between convection and documentation.
(2) FILE pointer FILE
Actually FILE is a new data type. Its a collection of basic data types for Turbo C2.0,
Its called a structure pointer. The concept of the structure will be described in detail in section iv, where the FILE is understood
For a data structure that includes information about information management, a document must be defined first when opening a file
A pointer.
(3) the function call format introduced in the future will directly write the data type and function return value of the formal parameters
Data type. For example, the function that opens the file above returns a file pointer with the form parameter
Both are character variables (string arrays or string Pointers).
Now lets look at the use of open file functions.
The first formal parameter in the fopen () function represents the file name, which can contain both path and filename.
Such as:
B: TEST. DAT
C: \ \ TC \ \ TEST DAT
If the path is written as C: \ TC \ test.dat is
您可能关注的文档
- 防喘震仪表工作简介(A brief introduction to anti-surge instrument).doc
- 防己地黄汤2(Yellow soup 2).doc
- 防火墙名词解释(Firewall terms explanation).doc
- 防溺水安全教育材料(Waterproof safety education material).doc
- 陈玉琴讲座对癌症的一些理解。(Chen yuqin's lecture on some understanding of cancer.).doc
- 除体内湿气的方子(Except for the damp in the body).doc
- 隔离变压器原理及应用(Principle and application of isolation transformer).doc
- 隔夜茶的妙用大全(Overnight tea is a great use of tea).doc
- 隔变压器(Isolation transformer).doc
- 赤壁方言小结(A small knot in chibi dialect).doc
文档评论(0)