c语言FILE结构和字符串读取

c语言FILE结构和字符串读取

软件:gcc 版本 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)

本文通过FILE结构 stdio.h中的定义, 解析c语言对标准输入和文件输入的实现,有助于深入理解和使用stdio.h 中的函数。

1 FILE结构


1.1 /usr/include/stdio.h

49行

typedef struct _IO_FILE FILE;

75行

#include <libio.h>

164-167行

/* Standard streams.  */
extern struct _IO_FILE *stdin;          /* Standard input stream.  */
extern struct _IO_FILE *stdout;         /* Standard output stream.  */
extern struct _IO_FILE *stderr;         /* Standard error output stream.  */

stdio.h文件的49行和164-167行显示:标准输入stdin、标准输出stdout和标准错误stderr,均为FILE结构的指针。

FILE结构的具体定义在文件libio.h中。

1.2 /usr/include/libio.h

123-138行

#define _IO_USER_BUF 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值