Re:‘Abusing’ the C switch statement – beauty is in the eye o...
by dllthomas on Thursday February 02, 2017 @11:06PM
(#13557588)
> Any context where you would want "if x == this, goto here; if x == that, goto there" is a potential place to use the switch statement.
Only if "here" and "there" are later on in the same block.
Any context where you would want "if x == this, goto here; if x == that, goto there" is a potential place to use the switch statement. Duff's device is a good example, but there are many things that can be built this way.