--- In [email protected], "Bill Cunningham" <[EMAIL PROTECTED]> wrote:
>
>     I get a comparsion between pointer and integer (I believe)
errror for 
> this code. It is the line after the fclose function.
> 
>     fclose(fp);
>     if(fp==-1) {
>       puts("close error");
>       ex;
>       }

fclose() returns an int, as you correctly say. That means you have to
do something like:

    int status;
    ...
    status = fclose(fp);
    if (status == -1) { ...

or to save more keystrokes:

    if (fclose(fp) == -1) { ...

The value of pointer fp is not modified by the fclose(), although the
data it points to probably is.

Reply via email to