fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void p2(unsigned int tmp)
  5. {
  6. printf("From p2: \n");
  7. printf("tmp = %d ,In hex tmp = %x\n", tmp, tmp);
  8. }
  9.  
  10. int main()
  11. {
  12. float fvar = 45.65;
  13.  
  14. p1(fvar);
  15. p2(fvar);
  16. printf("From main:\n");
  17. printf("sizeof(int) = %lu, sizeof(float) = %lu\n", sizeof(int),
  18. sizeof(float));
  19. unsigned int ui;
  20. memcpy(&ui, &fvar, sizeof(fvar));
  21. printf("fvar = %x\n", ui);
  22. return 0;
  23. }
  24.  
  25. void p1(unsigned int tmp)
  26. {
  27. printf("From p1: \n");
  28. printf("tmp = %d ,In hex tmp = %x\n", tmp, tmp);
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:14:5: error: implicit declaration of function ‘p1’ [-Werror=implicit-function-declaration]
     p1(fvar);
     ^~
prog.c: At top level:
prog.c:25:6: error: conflicting types for ‘p1’ [-Werror]
 void p1(unsigned int tmp)
      ^~
prog.c:14:5: note: previous implicit declaration of ‘p1’ was here
     p1(fvar);
     ^~
cc1: all warnings being treated as errors
stdout
Standard output is empty