检测流文件结束符

来源:互联网 发布:csgo武器数据 编辑:程序博客网 时间:2024/06/11 11:27

检测流上的文件结束符

 

 

#include <stdio.h>int main ( void ){FILE *stream;/* open a file for reading */stream = fopen ( "DUMMY.FIL", "r" );/* read a character from the file */fgetc ( stream );/* check for EOF */if ( feof ( stream ) )printf ( "We have reached end-of-file\n" );/* close the file */fclose ( stream );return 0;}


 

原创粉丝点击