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 )中。
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库函数逐个读取字符。
To simplify the code, the getc method returns the next character from the buffer while putc replaces the character in the buffer where it is available for the next call to getc .
要简化该代码,getc方法返回缓冲区中的下一个字符,而putc替换缓冲区中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函数都需要它。
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函数都需要它。
应用推荐