Quote:
Originally posted by bwkaz
Second, switches don't jump directly to the proper case, or at least not necessarily. They function the same as an if-else structure if you have the break; statements in there, and the assembly that gcc outputs is very similar also (basically, it evaluates each case and compares it to the switched value, executes the first that matches, and keeps executing code until it sees a break or the end of the switch
Wow...you sure about that? All the time I've assumed that a switch statement used some sort of jump table array thing. (That was my reason why you couldn't do "real" tests in there, other than "is it a certain integer?")