c语言output标准库函数,C语言文件输入输出函数(C language input output function).doc...

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, it's 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. It's a collection of basic data types for Turbo C2.0,

It's 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 let's 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 \

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值