[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

F.10 The switch() Statement

We indent case one level beneath switch(), and the code within each case beneath the case. Each case should have one line of vertical whitespace above it:

switch(foo) {

    case some_const:
        foo();

        break;

    case some_other_const:
        bar();

        break;	    

    default:
        exit(1);

        break;
}

This document was generated on September 20, 2023 using texi2html 5.0.