Re: Funny loop with post-increment.

silky <[email protected]> Tue, 19 Feb 2008 22:22:42 +1100
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
On Feb 19, 2008 10:18 PM, Frans Bouma <[email protected]> wrote:
[snip]
> > >         In other places where break is used, it does something: it breaks
> > > out of the block it is in, though in switch/case it's unnecessary.
> >
> > it is necessary given the above.
>
>         No, it's not.

Yes it is. What if I want to do nothing in case 1, print in case 2,
and do something in the default case? How do I do it without break?


> switch(n){
>  case 1:
>  case 2:
>   Console.WriteLine("a");
>  case 3:
>   Console.WriteLine("b");
> }
>
>         would be perfectly fine. As there's no fall through after code blocks,
> the block of case 1/2 won't end up in the block of case 3. However 'break' is
> required after the code of case 2.
>
>         Anyway, it's never going to change :)
>
>
>                 FB

--
http://lets.coozi.com.au/

A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com