General question about switch-case statements. If I do something like this:
switch (x)
{
case 1:
{
int i = 0;
int z = 12;
break;
}
case 2:
{
int i = 17;
int j = 22;
break;
}
}
Would i and z in the first case be 'created' and 'destroyed' (memory wise) only if the first case condition is met? Same for case 2? I'm mainly thinking of scope but i haven't used switch-case in a while and i forgot.