满意答案
sseeeiiv56
2013.06.09
采纳率:50% 等级:12
已帮助:21064人
int ferror ( FILE * stream );
Check error indicator
Checks if the error indicator associated with stream is set, returning a value different from zero if it is.
This indicator is generaly set by a previous operation on the stream that failed.
Parameters
stream
Pointer to a FILE object that identifies the stream.
Return Value
If the error indicator associated with the stream was set, the function returns a nonzero value.
Otherwise, it returns a zero value.
根据库函数的说明,非零的error indicator没有具体的含义,就是用来指示这个FILE tream当前有错误发生,一般是为增强代码强健性加入的检验性程序,避免在文件操作时出现程序锁死或错误。 程序中有些错误的具体错误信息往往很难捕捉和辨别的,而且一般是与编译器和操作系统平台相关的。
00分享举报