鱼C论坛

 找回密码
 立即注册
查看: 1382|回复: 2

大佬看看我

[复制链接]
发表于 2021-3-15 22:47:47 From FishC Mobile | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
Scanf()==1表示的是什么意思
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-3-16 15:04:57 | 显示全部楼层
那我来看看你吧,这个其实要你看scanf()这个函数的原型去看他的返回值了,你可以参考这个网站: https://www.cplusplus.com/reference/cstdio/scanf/

有用的信息就是return value :
Return Value
On success, the function returns the number of items of the argument list successfully filled. This count can match the expected number of items or be less (even zero) due to a matching failure, a reading error, or the reach of the end-of-file.

If a reading error happens or the end-of-file is reached while reading, the proper indicator is set (feof or ferror). And, if either happens before any data could be successfully read, EOF is returned.

If an encoding error happens interpreting wide characters, the function sets errno to EILSEQ.
意思就是说,如果成功会返回成功输入的个数,scanf() == 1,就说明成功输入了一项。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-3-16 15:09:20 | 显示全部楼层
成功输入了一项,这个你要看scanf()这个函数的返回值,也就是return value,百度一下就有了一般
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-22 05:29

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表