exit,fread,fgetc

本文详细介绍了C语言中文件操作的基础知识,包括如何使用putchar函数打印换行符到屏幕,exit函数的作用及其参数含义,fread函数读取文件的具体行为及返回值解释,以及fgetc函数读取文件字符的基本用法和返回值说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.putchar(10)   // print a feed line to the screen


2.The void exit( int status ) function 

       remarksThe exit function terminate the calling process. exit calls, in last-in-first-out(LIFO) order, the functions registered by atexit and _onexit, then flushes all file buffers before terminating the process .The status value is typically set to 0 indicate a normal exit and set to some other value to indicate an error.


3. The fread function returns the number of full items actually read, which may be less than count if an error or if the end of the file is encountered reaching count. Use the feof or ferrror function to distinguish a read error from an end-of-file condition. If size or count is 0, fread function return 0 and the buffer contents are unchanged.


4. int fgetc(FILE *stream) 


       Return value: fgetc return the character read as an int or return EOF to indicate an error or end of file.

       Remarks: fgetc function reads a single character from the current position of a file, this is the file associated with stream. The function then increments the associate file pointer (if defined) to point to the next character. If the stream is at end of file,the end-of-file indicator for the stream is set.

















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值