Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

initialize variable in switch case c++

switch (val)
{   
case VAL:  
{
  // This will work
  int newVal = 42;  
  break;
}
case ANOTHER_VAL:  
...
break;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #initialize #variable #switch #case
ADD COMMENT
Topic
Name
2+2 =