函数名: getc 功 能:从流中取字符 用 法: int getc(FILE *stream); //read the next character from stream and return it as an unsigned char cast to a int ,or EOF on end of file or error. 从文件指针stream指向的文件流中读取一个字符,并把它作为函数值返回给整型变量ch; 如果读取失败或者到了文件结束标志返回EOF(-1)
Repeat the loop until getc returns EOF.
重复该循环直至getc返回e OF。
(As we've seen above, fgets returns NULL while getc returns EOF.)
正如我们在上面看到的,fgets返回NULL而getc返回e OF。
Then, whenever we call either fgets() or getc(), the data is passed into our program variables (line or c).
然后,每当我们调用 fgets() 或 getc() ,数据被传递到我们的程序变量( line 或 c )中。
应用推荐