Here is the complete sources and what the compile spits out at compile 
time.

#include <stdio.h>
#include <stdlib.h>

int main (void) {
       FILE *fp;
       char a[]="hello\n";
       fp=fopen("file","a");
       if (fp==NULL) {
          puts("open error");
          exit(EXIT_FAILURE);
          }
       fprintf(fp,"%s",a);
       fclose(fp);
       if (fp==EOF) {
           puts("close error");
           exit(EXIT_FAILURE);
           }
return 0;
}

gcc: 2: No such file or directory
p.c: In function `main':
p.c:14: warning: comparison between pointer and integer

Bill

Reply via email to