"case range" syntax

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

I've only just become aware of this way of using ranges in case statements!

switch (x) {
    case 1 ... 4:
        // matches x == 1, 2, 3, or 4
        break;
}