fork download
  1. #include <stdio.h>
  2.  
  3. void f(char *a, char *b) {
  4.  
  5. int a;
  6. int x = *a;
  7. *a = *b;
  8. *b = x;
  9. printf("%c", *a);
  10. printf("%c", *b);
  11.  
  12. }
  13.  
  14. int main(void) {
  15. char *a;
  16. char *b;
  17. *a = 'a';
  18. *b = 'b';
  19. f(a,b);
  20. return 0;
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 2168KB
stdin
Standard input is empty
compilation info
prog.c: In function 'f':
prog.c:5:6: error: 'a' redeclared as different kind of symbol
  int a;
      ^
prog.c:3:14: note: previous definition of 'a' was here
 void f(char *a, char *b) {
              ^
prog.c:6:10: error: invalid type argument of unary '*' (have 'int')
  int x = *a;
          ^
prog.c:7:2: error: invalid type argument of unary '*' (have 'int')
  *a = *b;
  ^
prog.c:9:15: error: invalid type argument of unary '*' (have 'int')
  printf("%c", *a);
               ^
stdout
Standard output is empty