Tag Info

New answers tagged


Several people have already mentioned the notion of matching multiple conditions, which is very valuable from time to time. However the ability to match multiple conditions does not necessarily require that you do the exact same thing with each condition that matches. Consider the following: switch (someCase) { case 1: case 2: ...


To answer two of your questions. Why does C need breaks? It comes down to Cs roots as a "portable assembler". Where psudo code like this was common:- targets=(addr1,addr2,addr3); opt = 1 ## or 0 or 2 switch: br targets[opt] ## go to addr2 addr1: do 1stuff br switchend addr2: do 2stuff br switchend addr3 do 3stuff ...

Top 50 recent answers are included