Hello: can I put on the case line more than one item to compare Like this
switch(aaa) { case: x or y or Z
}
I try with logical OR but doesnÂ't work.
Thanks and excuse me my english
Only constants allowed in case values - no expressions.
But you can write:
switch (aaa) { case x: case y: case z: do_something(); break; case w: do_something_else(); break; default: fallback_action(); }
This is plain, vanilla, standard 'C' - check your 'C' textbook.
Hint: What happens if you don't put a break at the end of a case clause...?