> Declaring a new variable must be done at the beginning of a new scope in
> C. Were not in C++ anymore Toto...   :)  The addition of the braces
> creates a new scope and therefore makes the declaration valid.  I do this
> all the time in switch statements.

So would you say that good coding would always have the braces like:

switch(something) {
        case x: {
                sometask1();
                break;
        }
        case y: {
                sometask2();
                break;
        }
}

> 
> -Paul
> 
> PS: now that I think of it, you can't do in in C++ either.  The
> declaration would be there in one case but not the others so what would
> the compiler do after the switch?
> 
> 


--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

Reply via email to