fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int cond = 2;
  6. switch (cond) {
  7. case 1:
  8. printf("case 1\n");
  9. int i = 1;
  10. case 2:
  11. printf("case 2: %d\n", i);
  12. } /* Here ends the life-time of i */
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 4504KB
stdin
Standard input is empty
stdout
case 2: 0