fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. FILE f;
  4. f = fopen("file","wb");
  5. printf("%d",f != NULL);
  6. fclose(f);
  7. return 0;
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:4:11: error: incompatible types when assigning to type ‘FILE {aka struct _IO_FILE}’ from type ‘FILE * {aka struct _IO_FILE *}’
         f = fopen("file","wb");
           ^
prog.c:5:23: error: invalid operands to binary != (have ‘FILE {aka struct _IO_FILE}’ and ‘void *’)
         printf("%d",f != NULL);
                       ^~
prog.c:6:16: error: incompatible type for argument 1 of ‘fclose’
         fclose(f);
                ^
In file included from prog.c:1:0:
/usr/include/stdio.h:239:12: note: expected ‘FILE * {aka struct _IO_FILE *}’ but argument is of type ‘FILE {aka struct _IO_FILE}’
 extern int fclose (FILE *__stream);
            ^~~~~~
stdout
Standard output is empty