|
ferrorfunction
<cstdio> int ferror ( FILE * stream ); Check error indicator Checks if the error indicator associated with stream is set, returning a value different from zero if it is.This indicator is generaly set by a previous operation on the stream that failed. Parameters
Return ValueIf the error indicator associated with the stream was set, the function returns a nonzero value.Otherwise, it returns a zero value. Example
This program opens an existing file called myfile.txt in read-only mode but tries to write a character to it, generating an error that is detected by ferror. Output: Error Writing to myfile.txt See also
|