fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char x;
  5. int a, b, c;
  6. fgets ("%c", &x);
  7. fgets ("%d %d", &a, &b);
  8. c = axb
  9. printf ("%d%c%d = %d", &a, &x, &b, &c);
  10. }
  11.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
+
1 7
compilation info
prog.c: In function ‘main’:
prog.c:6:15: warning: passing argument 2 of ‘fgets’ makes integer from pointer without a cast [-Wint-conversion]
  fgets ("%c", &x);
               ^
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘int’ but argument is of type ‘char *’
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ^~~~~
prog.c:6:2: error: too few arguments to function ‘fgets’
  fgets ("%c", &x);
  ^~~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: declared here
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ^~~~~
prog.c:7:18: warning: passing argument 2 of ‘fgets’ makes integer from pointer without a cast [-Wint-conversion]
  fgets ("%d %d", &a, &b);
                  ^
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘int’ but argument is of type ‘int *’
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ^~~~~
prog.c:7:22: warning: passing argument 3 of ‘fgets’ from incompatible pointer type [-Wincompatible-pointer-types]
  fgets ("%d %d", &a, &b);
                      ^
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘FILE * restrict {aka struct _IO_FILE * restrict}’ but argument is of type ‘int *’
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
              ^~~~~
prog.c:8:6: error: ‘axb’ undeclared (first use in this function)
  c = axb
      ^~~
prog.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
prog.c:9:2: error: expected ‘;’ before ‘printf’
  printf ("%d%c%d = %d", &a, &x, &b, &c);
  ^~~~~~
prog.c:5:12: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
  int a, b, c;
            ^
stdout
Standard output is empty