scanf返回值
来源:互联网 发布:c语言中长整型变量 编辑:程序博客网 时间:2024/06/07 03:03
关于scanf的返回值,MSDN里是这样写的:
Both scanf and wscanf return the number of fields successfully converted
and assigned; the return value does not include fields that were read but
not assigned. A return value of 0 indicates that no fields were assigned.
The return value is EOF for an error or if the end-of-file character or the
end-of-string character is nocountered in the first attempt to read a character.
如:
scanf("%d%d", &a, &b);
如果a和b都被成功读入,那么scanf的返回值就是2
如果只有a被成功读入,返回值为1
如果a和b都未被成功读入,返回值为0
如果遇到错误或遇到end of file,返回值为EOF。
Both scanf and wscanf return the number of fields successfully converted
and assigned; the return value does not include fields that were read but
not assigned. A return value of 0 indicates that no fields were assigned.
The return value is EOF for an error or if the end-of-file character or the
end-of-string character is nocountered in the first attempt to read a character.
如:
scanf("%d%d", &a, &b);
如果a和b都被成功读入,那么scanf的返回值就是2
如果只有a被成功读入,返回值为1
如果a和b都未被成功读入,返回值为0
如果遇到错误或遇到end of file,返回值为EOF。
不经意中发现scanf()的返回值问题,自己试验和了解了一下,一些所知与各位分享;
- scanf 返回值
- scanf 返回值
- scanf的返回值
- scanf返回值
- scanf的返回值
- 关于scanf返回值
- scanf的返回值
- SCANF返回值问题
- scanf()返回值
- scanf()函数返回值
- scanf的返回值
- scanf返回值问题
- scanf函数返回值
- scanf返回值
- scanf返回值
- 关于scanf的返回值
- 关于scanf的返回值
- 关于scanf的返回值
- C++实现回文
- ajaxpro综合示例-ajaxpro无刷新更新gridview数据
- DX学习笔记
- 邮件发送的帮助类
- VC 绘制颜色渐变区域
- scanf返回值
- prototype中的继承
- IIS状态代码的含义
- Building the android code
- Tuscany SCA与OSGI的结合方式
- ASP.NET和网页游戏的设想
- 函数指针和指针函数
- 如何hook只知道地址的0x00******的函数
- QT下sleep的实现