下面是声明两个int变量并尝试在switch语句中使用它们的代码.这是C++中的合法操作吗?如果没有,为什么不呢?
int i = 0; int x = 3; switch (i) { case x: // stuff break; case 0: // other stuff break; }
c++ switch-statement
c++ ×1
switch-statement ×1