ferror.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 39 行

GML
39
字号
.func ferror
#include <stdio.h>
int ferror( FILE *fp );
.ixfunc2 '&StrIo' &func
.ixfunc2 '&Errs' &func
.funcend
.desc begin
The &func function tests the error indicator for the stream
pointed to by
.arg fp.
.desc end
.return begin
The &func function returns non-zero if the error indicator is set for
.arg fp.
.return end
.see begin
.seelist &function. clearerr feof ferror perror strerror
.see end
.exmp begin
#include <stdio.h>

void main()
  {
    FILE *fp;
    int c;
.exmp break
    fp = fopen( "file", "r" );
    if( fp != NULL ) {
      c = fgetc( fp );
      if( ferror( fp ) ) {
        printf( "Error reading file\n" );
      }
    }
    fclose( fp );
  }
.exmp end
.class ANSI
.system

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?