如何获取 int ferror(FILE*)
返回的错误代码消息?对于 errno
,有 char * strerror(int)
。 ferror 返回的代码是什么?如果 char * strerror(int)
对此也有好处,那么我需要它的引用(我没有找到这种情况的任何指标)。
最佳答案
来自 this reference page :
The ferror() function shall test the error indicator for the stream pointed to by stream.
这意味着 ferror
返回一个 bool 值,告诉您是否有错误,仅此而已。但根据 POSIX 规范,errno
的值将包含一个错误代码,以防出现故障。
关于c++ - ferror() 返回值的消息文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15473699/