在这个例子中:
#include <stdio.h>
main()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
我不太理解。putchar()函数会输出字符,但是为什么在EOF之后它会输出所有字符,并且它是如何记住这些字符的呢?谢谢。
putchar()
? - mob