return value of fgets

fgets return value:(error occurs)
please tell me difference in between these two things by example -
1.If the end-of-file is encountered while attempting to read a character, the eof indicator is set (feof). If this happens before any characters could be read, the pointer returned is a null pointer (and the contents of str remain unchanged).
2.If a read error occurs, the error indicator (ferror) is set and a null pointer is also returned (but the contents pointed by str may have changed).
Topic archived. No new replies allowed.