fork download
  1. #include <stdio.h>
  2.  
  3. #define ERROR_CODE_1 1
  4. int err = 0;
  5.  
  6. //A disaster occurs!
  7.  
  8. err = ERROR_CODE_1;
  9.  
  10. switch(err){
  11.  
  12. case 1:
  13.  
  14. printf("Testing special case error handling now. ");
  15. default:
  16.  
  17. printf("Testing basic error handling now.");
  18. break;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:8:1: warning: data definition has no type or storage class
 err = ERROR_CODE_1;
 ^~~
prog.c:8:1: warning: type defaults to ‘int’ in declaration of ‘err’ [-Wimplicit-int]
prog.c:8:1: error: redefinition of ‘err’
prog.c:4:5: note: previous definition of ‘err’ was here
 int err = 0;
     ^~~
prog.c:10:1: error: expected identifier or ‘(’ before ‘switch’
 switch(err){
 ^~~~~~
stdout
Standard output is empty