请教一个C语言的问题
while(scanf("%d",&a)==EOF)
这条语句是什么意思?
scanf调用后会返回一个函数值么?
[解决办法]
On success, the function returns the number of items successfully read. This count can match the expected number of readings or fewer, even zero, if a matching failure happens.
In the case of an input failure before any data could be successfully read, EOF is returned.
[解决办法]
查MSDN是Windows程序员必须掌握的技能之一。
[解决办法]
这个是判断是否到了文件末尾
scanf()的返回值是成功读取了多少个就返回几,如果失败则返回零
[解决办法]
会有一个返回值,返回的是输入的个数。这是成功的情况下,如果出错,则返回0.