📜  c++代码示例中的case标签

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

代码示例1
switch(foo) {
  case 1:
    int i = 42; // i exists all the way to the end of the switch
    dostuff(i);
    break;
  case 2:
    dostuff(i*2); // i is *also* in scope here, but is not initialized!
}