Guest_imported
New member
- Jan 1, 1970
- 0
Hi,I'm a beginner.Declarations in switch statement must be reachable and It must not be possible to bypass them.What I don't understand is why in Case 2,where there are no braces,declaration could get bypassed?I can't see any reason why It would be bypassed.Can someone explain it?
switch(test)
{
case 1:
{
int j=2;
cout <<test +j;
break;
}
case 2:
cout<<endl << test;
int m=4; //how can this one
break; get bypassed?
}
Also,I wanted to use output manipulator BOOLALPHA
to display boolean values on the screen,but
compiler simply ignores the statement.
cout<<boolalpha;
Thank you for helping me out
switch(test)
{
case 1:
{
int j=2;
cout <<test +j;
break;
}
case 2:
cout<<endl << test;
int m=4; //how can this one
break; get bypassed?
}
Also,I wanted to use output manipulator BOOLALPHA
to display boolean values on the screen,but
compiler simply ignores the statement.
cout<<boolalpha;
Thank you for helping me out