An amusing piece of code

Bob Bickford rab at well.UUCP
Thu Apr 10 22:33:22 AEST 1986


,,,,

  How about this:


    Switch (thing)
        case A:
            A-code;
            break;
        case B:
        case C:
        case D:
            BCD common code
            switch (thing)
                case B: B code; break;
                case C: C code; break;
                case D: D code; break;
            break;
        case E:
            E code;
            break;


  Of course, the inner switch and the BCD common code can be swapped if
the order of execution is crucial.

  I didn't like your example code because I found it too hard to follow
the logic, with the brackets placed in that way, which I gather is what you
were looking for a solution for....


-- 
Robert Bickford     {lll-crg,hplabs}!well!rab



More information about the Comp.lang.c mailing list