fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var i = 2;
  9.  
  10. switch (i)
  11. {
  12. case 1:
  13. var what = "WHAT";
  14. break;
  15.  
  16. case 2:
  17. what = "WHERE";
  18. break;
  19. }
  20. }
  21. }
Compilation error #stdin compilation error #stdout 0s 29016KB
stdin
Standard input is empty
compilation info
prog.cs(13,5): error CS0841: A local variable `what' cannot be used before it is declared
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty