switch (expr) {
  case c1:
        statements // do these if expr == c1
        break;
  case c2: 
        statements // do these if expr == c2
        break;
  case c2:
}

Example 1: Potential bugs can be hidden.

Back to Article