Quote from BigEd781Quote from DjmcaveAnd use range on switch :
case '0'..'9' : cout << "The input is an number." << endl;
case 'a'..'z' : cout << "The input is an lowercase letter." << endl;
case 'A'..'Z' : cout << "The input is an uppercase letter." << endl;
If i remember correctly that is how.
That is not valid C++. C++ does not supports ranges in switch statements (or, for that matter, range literals at all). Otherwise it would be impossible to implement the switch as a jump table, i.e., provide O(1) complexity in time. Each case must correspond to one and only one integral constant. That looks more like Ruby or Python (or some other higher level language)
Don't remember what language it was( could be specific compiler ? ) ..
And if you think a switch is a O(1) operation... you might get a surprise...