fork(3) download
  1. #include <stdio.h>
  2. const int FOO = 10;
  3.  
  4. int main(int argc, char** argv)
  5. {
  6. switch(argc)
  7. {
  8. case ((int) "toto"[0]): { printf("foo\n"); }
  9. default: { printf("default\n"); }
  10. }
  11. }
  12.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:8:9: error: case label does not reduce to an integer constant
         case ((int) "toto"[0]): { printf("foo\n"); }
         ^~~~
stdout
Standard output is empty