Occurs on attempt to call file write/read/close function on null file handle.
Example (incorrect):
fh = fopen("nonexistingfile.txt", "r"); //
this file does not exist
fputs("Test",
fh ); // error here, fh could be null
fclose( fh ); //
wrong, fh could be null
Correct usage would look like this:
fh = fopen("nonexistingfile.txt", "r"); //
this file does not exist
if( fh ) //
correct, call subsequent file read/write/close only when file handle is OK
{
fputs("Test",
fh );
fclose(
fh );
}