On 10/28/07, 洪海昆 <[EMAIL PROTECTED]> wrote:

> switch (   ?  ) {        ---------------if the case can be a>b,what should be 
> put in the blanket?
>     case  a>b :       -----------does the case be "a>b"

Switch needs an int value to switch. While a > b does resolve to an
int (a non-negative one), all you are doing is testing its boolean
value, and you'd be better off using an if/then clause (it's more
obvious what you are doing). For switch, you want to use it when have
more than two different paths the logic can take.

>         a nested  programming      ------can i put a nested programming here

Sure, you can even nest switch statements. But be careful, it can get
very convoluted if you go more than one level.

>         break;
> }

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to