解釋
函式名: feof功能: 檢測流上的檔案結束符
用法: int feof(FILE *stream);
程式例
#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;
}