Re: [Off-Topic Code] Case Statements

From: Brian Gray (mandy@NETCOM.COM)
Date: 08/31/97


On Sun, 31 Aug 1997, David Eliott wrote:

> Look at this piece of code:
> void blah(void)
> {
>   switch(arg) {
>     case blah: return ??; break;
>     case blah: return ??; break;
>     case blah: return ??; break;
>     default: return ??; break;
>   }
> }
>
> Now, are those break statements needed? doesn't the function return,
> stop the function?

No, and yes.  The breaks are redundant.  Take them out.

 -- Brian


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST