Is it possible to create a range within case? I know you can handle ranges easily with nested if then else, but I wanted to do some creative programming. If it's possible, how would the syntax work? Obviously not like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
switch (shoe_size)
{
case shoe_size <= 6: cout << "\nSmall.";
break;
case shoe_size <= 9: cout << "\nMedium.";
break;
case shoe_size =< 100: cout << "\nLarge.";
break;
default: cout << "\nYou got big damn feet!";
}
The error that comes up is "shoe_size cannot appear in a constant-expression." Just satisfying curiosity here. No rush!