Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed a coding typo.

...

Code Block
bgColor#ccccff
typedef enum { Red, Green, Blue } Color;
const char* f(Color c) {
  caseswitch (c) {
    switchcase Red: return "Red";
    switchcase Green: return "Green";
    switchcase Blue: return "Blue";
    default: return "Unknown color";   /* not dead code */
  }
}

void g() {
  Color unknown = (Color)123;
  puts(f(unknown));
}

...