title | ms.custom | ms.date | ms.technology | ms.topic | apiname | apilocation | apitype | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | author | ms.author | ms.workload | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ferror | Microsoft Docs |
11/04/2016 |
|
reference |
|
|
DLLExport |
|
|
|
528a34bc-f2aa-4c3f-b89a-5b148e6864f7 |
corob-msft |
corob |
|
Tests for an error on a stream.
int ferror(
FILE *stream
);
stream
Pointer to FILE structure.
If no error has occurred on stream, ferror returns 0. Otherwise, it returns a nonzero value. If stream is NULL, ferror invokes the invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, this function sets errno to EINVAL and returns 0.
See _doserrno, errno, _sys_errlist, and _sys_nerr for more information on these, and other, error codes.
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.
Function | Required header |
---|---|
ferror | <stdio.h> |
For additional compatibility information, see Compatibility.
See the example for feof.
Error Handling
Stream I/O
clearerr
_eof
feof
fopen, _wfopen
perror, _wperror