<分区>
Possible Duplicate:
C# switch variable initialization: Why does this code NOT cause a compiler error or a runtime error?
在这个 switch 语句中(令我惊讶的是编译和执行没有错误),变量 something 没有在情况 2 中声明,并且情况 1 永远不会执行。这怎么有效?变量 something 不声明怎么用?
switch(2){
case 1:
string something = "whatever";
break;
case 2:
something = "where??";
break;
}