ferror
Visual Studio .NET 2003
Tests for an error on a stream.
int ferror( FILE *stream );
Parameter
- stream
- Pointer to FILE structure.
Return Value
If no error has occurred on stream, ferror returns 0. Otherwise, it returns a nonzero value.
Remarks
The ferror routine (implemented both as a function and as a macro) tests for a reading or writing error on the file associated with stream. If an error has occurred, the error indicator for the stream remains set until the stream is closed or rewound, or until clearerr is called against it.
Requirements
| Function | Required header | Compatibility |
|---|---|---|
| ferror | <stdio.h> | ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP |
For additional compatibility information, see Compatibility in the Introduction.
Libraries
All versions of the C run-time libraries.
Example
See the example for feof.
See Also
Error Handling Routines | Stream I/O Routines | clearerr | _eof | feof | fopen | perror | Run-Time Routines and .NET Framework Equivalents