Hello all, i have a sort of silly question to ask.
My question is:
"What would be the best way to replace switch statements without using if?"
Also, is there a way to break out of a multiple level nested conditional operator being used as an lvalue-less statement?
Code:
int a,b,c; /* Just exemplary variables */
a ? (b ? (c ? 1:0) : XXX ):0; /* Expression used for it's sideeffects */
At the point where i assign the value XXX i want to break, or goto (if possible)
The actual expression is much more complex, and would obfuscate things if i pasted it.
It is forbidden to use 'if' or 'switch' as a solution.
It is not for an assignment, i was just curious and thought it would make interesting code since then one could replace an entire switch in one and only statement.
Thanks in advance for any try on this.