fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. foo("%x");
  6. return 0;
  7. }
  8.  
  9. void foo(char *str)
  10. {
  11.  
  12. char c='c';
  13. printf(str);
  14.  
  15. printf("\n%x",&c);
  16. }
Compilation error #stdin compilation error #stdout 0s 2112KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:5:2: warning: implicit declaration of function 'foo' [-Wimplicit-function-declaration]
  foo("%x");
  ^
prog.c: At top level:
prog.c:9:6: warning: conflicting types for 'foo'
 void foo(char *str)
      ^
prog.c:5:2: note: previous implicit declaration of 'foo' was here
  foo("%x");
  ^
prog.c: In function 'foo':
prog.c:15:9: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'char *' [-Wformat=]
  printf("\n%x",&c);
         ^
prog.c:16:9: error: \x used with no following hex digits
  printf("\x hi");
         ^
stdout
Standard output is empty