作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
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;
}
我是一名优秀的程序员,十分优秀!