On Mon, Aug 4, 2008 at 8:36 PM, Bill Cunningham <[EMAIL PROTECTED]> wrote:

>    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 ?

Can you show a full example (including include statements, main(), etc
-- cut and paste from your code editor) and the actual error you are
getting from the compiler? Do you have #include <stdio.h> at the top
of your program?

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
 If I were to divulge it, it would overturn the world."
 -- Jelaleddin Rumi

Reply via email to