What's the best way to indent a switch?
Most people use this:
But to me that looks like it's indented twice, sort of like this:Code:switch(var) { default: somefunc(); break; }
Some people use this:Code:if(var) { somefunc(); }
But that looks like it wasn't indented at all.Code:switch(var) { default: somefunc(); break; }
I like this style (although it looks indented twice, too):
But a book I read suggested that "case 0: {" was illegal. Is it?Code:switch(var) { default: { somefunc(); } break; }
Are there any other ways to indent a switch?



LinkBack URL
About LinkBacks


