#include
int main()
{
int a = 1;
switch(a) {
int b=20;
printf("This gets called!\n");
case 1:
printf("b is %d\n",b);
break;
default:
printf("b is %d\n",b);
break;
}
return 0;
}
The key here is that int b=20;
never gets called. The compiler will create the variable b
but it never gets initialised.