I opened a file, the stream is found at the address of pointer ptr. I am attempting to see whether or not a file is blank. Using the following
if (fgetc(ptr) != EOF)
works as expected. When the file is blank, the statement is not executed. When the file is not blank, the statement is not executed.
However, using
if (!feof(ptr))
always executes the statement.
Why does this happen? Is there a way to use the feof function?