Check for EOF when using fgets
anyone who can tell me about a way of checking for EOF within this while loop. I can't think of a good sollution. I would like to print an error if something else than EOF is found by fgets.
int main (void)
char filename, buf;
puts("Enter file to review");
if ((fp = fopen(filename, "r")) == NULL)
if (fgets(buf, 200, fp) == NULL)
puts("Error2 or EOF");