Re: [OFF-TOPIC] question about switch, return, break

From: Sean butler (sbutler@DEVEAST.COM)
Date: 12/19/97


>Uhm, I said ANSI C, not 'gcc'.  For your information, while gcc, for
>the most part, follows the ANSI standard, it does not do so to the
>letter.

Well okay try that code on any ANSI compiler then, I just said gcc since
it is what most of us use, and since it is mostly ANSI compliant.
But don't let my words (or your eyes as you watch it compile) fool you.
Let our bible speak for itself:

        3.4 Switch

        switch (expression) {
                case const-exp: statements
                case const-exp: statements
                default: statements
        }

        _The C Programming Language, Second Edition, (ANSI C)_, Kernighan & Ritchie


        Notice there is no mention of break here.  If you would like I could show
        you how Ritchie defines a "statement."  I think however that any good C
        programmer owns this book and will know how he defines a "statement."
        I assure you that it is not mandatory for it to contain a break.

>
>BTW, is there such a thing as being "simply wrong"?
>

Sure there is.  You are "simply wrong" when you make a simple or obvious
mistake.

ObCircle:
I created a tokenizer, takes a string and a set of token delimiters and
returns a pointer
to a structure containing a list of the tokens in the string.  Any interest
in that?  I
find it useful for parsing the arguments to commands and skills.

--Sean


     +------------------------------------------------------------+
     | 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