When I use braces around case code block in C++ to localize variables should I put break inside or outside the block?
case FOO: // 'break' inside
{
int i;
doStuff();
break;
}
case BAR: // 'break' outside
{
int i;
doStuff();
}
break;
Thanks.
It’s a matter of style.
I would put
breakoutside the closing brace just to make it more readable.