[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

ferror

Syntax

 
#include <stdio.h>

int ferror(FILE *file);

Description

This function can be used to indicate if the given file has encountered an error or not. See section clearerr.

Return Value

Nonzero for an error, zero otherwize.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

 
if (ferror(stdin))
  exit(1);