Answers for "c++ switch variable declaration"

C++
-1

initialize variable in switch case c++

switch (val)
{   
case VAL:  
{
  // This will work
  int newVal = 42;  
  break;
}
case ANOTHER_VAL:  
...
break;
}
Posted by: Guest on February-23-2021

Browse Popular Code Answers by Language