Possible Duplicate:
C# switch variable initialization: Why does this code NOT cause a compiler error or a runtime error?
In this switch statement (which to my surprise compiles and executes without error), the variable something is not declared in case 2, and case 1 never executes. How is this valid? How can the variable something be used without being declared?
switch(2){
case 1:
string something = "whatever";
break;
case 2:
something = "where??";
break;
}