[C] 检测流上的文件结束符 →→→→→进入此内容的聊天室

来自 , 2020-10-04, 写在 C, 查看 126 次.
URL http://www.code666.cn/view/efdf562c
  1. #include <stdio.h>
  2.  
  3. int main ( void )
  4. {
  5.         FILE *stream;
  6.  
  7.         /* open a file for reading */
  8.         stream = fopen ( "DUMMY.FIL", "r" );
  9.  
  10.         /* read a character from the file */
  11.         fgetc ( stream );
  12.  
  13.         /* check for EOF */
  14.         if ( feof ( stream ) )
  15.                 printf ( "We have reached end-of-file\n" );
  16.  
  17.         /* close the file */
  18.         fclose ( stream );
  19.         return 0;
  20. }
  21.  

回复 "检测流上的文件结束符"

这儿你可以回复上面这条便签

captcha