Use ferror()
to check for any accumulated errors, for example, after a long string of stdio calls. The ferror()
function tests the error indicator for a specified stream and returns returns nonzero if and only if the error indicator is set for stream.
Non-Compliant Coding Example
...