I can't seem to get error checking to work. I have to leave it out of my 
programs for example,

char a[]="hello\n";
FILE *fp;
fp=fopen("file","a");
if (fp==NULL) {
   puts("fopen error");
   exit(1);
   }

My compiler says it's an illegal comparison to a pointer. If there is and 
error fopen returns NULL. I have this same problem with fclose and it's 
supposed to return EOF on error. What am I doing wrong ?

Bill

Reply via email to