3.7.3. Case ranges

You can specify ranges of values in switch statements.

Example

int Case_Ranges_0(int arg)
{
    int aLocal;
    int bLocal =arg;
    switch (bLocal)
    {
        case 0 ... 10:
            aLocal= 1;
            break;
        case 11 ... 100:
            aLocal =2;
            break;
        default:
            aLocal=-1;
    }
    return aLocal;
}
Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential