函数名: 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)
Then, whenever we call either fgets() or getc(), the data is passed into our program variables (line or c).
然后,每当我们调用 fgets() 或 getc() ,数据被传递到我们的程序变量( line 或 c )中。
The logic used for form-feed-delimited pages is roughly the same, but slightly simpler, as there is no need for a line counter: Read char by char using the getc library function.
用于换页定界的页的逻辑大体上相同,只是稍稍简单一些,因为不需要行计数器:使用getc库函数逐个读取字符。
It is needed for the file opening, closing, reading, and writing functions (fopen , fclose , fgets , getc , and so on), for the printf family of functions, and for the setvbuf function.
文件的打开、关闭、读和写函数(fopen 、fclose 、fgets 、getc等等)、printf函数系列和setvbuf函数都需要它。
应用推荐