什么是“空项数"?在fread()中? [英] What is "short item count" in fread()?

查看:136
本文介绍了什么是“空项数"?在fread()中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我是'man fread'时,我得到了:

When I was 'man fread', I got this:

返回值
fread()和fwrite()返回成功读取或写入的项目数(即,不是字符数).如果有错误 发生,或结束- 达到文件总数,返回值是短项计数(或零).

RETURN VALUE
fread() and fwrite() return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end- of-file is reached, the return value is a short item count (or zero).

fread()不能区分文件结尾和错误,调用者必须使用feof(3)和ferror(3)来确定发生了什么.

fread() does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred.

所以我的问题是如何理解空项数".请忍受我的英语.为什么这里涉及"short"类型?有人可以举例说明短缺项目数"是什么样的吗?谢谢.

So my question is to how to understand "short item count". Please bear with my English. Why here involves type "short"? Can you someone give an example of what does "short item count" look like? Thanks.

推荐答案

如果您想要4,而您有3,则您简称1.

If you want 4, and you have 3, then you're short 1.

这篇关于什么是“空项数"?在fread()中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆