📜  在switch case c ++代码示例中初始化变量

📅  最后修改于: 2022-03-11 14:44:56.949000             🧑  作者: Mango

代码示例1
switch (val)
{   
case VAL:  
{
  // This will work
  int newVal = 42;  
  break;
}
case ANOTHER_VAL:  
...
break;
}