请教各位EOF是什么该怎么用
#include <stdio.h>int main()
{
long nc;
nc = 0;
while(getchar() != EOF)
++nc;
printf("%ld", nc);
return 0;
}
此程序有什么作用,其中EOF有什么作用。
.Write a program to print the same string if it encounter that it had reached to the end of the string .for example if string is “I am a student” it should print the same string on reaching the end of the given string { hint use EOF getchar ,putchar keywords.这是我们作业,不知道该怎么用EOF,请各位指点。