读书人

【VC编程技能】文件?2.1EOF的误区

发布时间: 2012-10-21 09:00:07 作者: rapoo

【VC编程技巧】文件?2.1EOF的误区

在编程的过程中,文件的操作是一个经常用到的问题,而关于EOF的理解大多人存在一个误区:“EOF--〉文件的结束符”!EOF是End Of File的缩写;在C语言中它是标准库stdio.h中定义的一个宏,而不是文件的结束符。

int ferror( FILE *stream );

Return Value

If no error has occurred on stream, ferror returns 0. Otherwise, it returns a nonzero value.

Parameter

stream

Pointer to FILE structure

Remarks

The ferror routine (implemented both as a function and as a macro) tests for a reading or writing error on the file associated withstream. If an error has occurred, the error indicator for the stream remains set until the stream is closed or rewound, or untilclearerr is called against it.





读书人网 >编程

热点推荐