|
The default behaviour of a switch statement is to fall through each case to the next one. That's why you usually have to put a "break" at the end of each case block. Remove each "goto" line and it should work as you wish.
As a rule of thumb, "goto" should never be used. I suspect there are extremely rare cases where it might be useful, but I have yet to discover any of these cases. Steer clear of goto.
|