The GNU case range extension allows case ranges in switch statements:
switch (value) {
case 1 ... 8:
printf("Hello, 1 to 8n");
break;
default:
printf("Hello, defaultn");
break;
}
How would you convert this to standard C (c99, or c89)? Add the individual case statements?
Edit: How would you handle very large switch statements specifically?
EDIT: To answer the comment.
If you have too many cases, then You might want to consider replacing the switch-case with if-else constructs. It can be much cleaner, concise & readable.