![]() |
VOOZH | about |
In C, ferror() is a built-in function used to check errors in files during file operations. It provides a simple way to do file operations without any interruption in your C program.
ferror() is a standard library function defined in <stdio.h> file.
ferror(fptr)
Parameter:
Return Value:
Note: To check error in file using ferror(), file must be open before it.
The following examples demonstrate the use of ferror() in C programs.
Data written successfully.
GeeksForGeeks! No error, Data read successfully