Answers for "case label in c++"

C++
0

case label in c++

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!
}
Posted by: Guest on December-24-2019

Browse Popular Code Answers by Language