Switch case common code
Larry Cipriani
lvc at danews.UUCP
Tue Jun 10 13:01:00 AEST 1986
The 'best' I think that can be done is to do something like:
switch (switch_variable)
{
case a: ...
...
goto common;
break;
case b: ...
...
common: common_code_for_a_and_b
break;
case c: ...
...
break;
}
Gotos are usually abused, but I think the for/while stuff shown
is just awful. I think this is a lot easier to understand. No ?
--
Larry Cipriani AT&T Network Systems
danews!lvc "Nothing is worse than an itch you can never scratch."
More information about the Comp.lang.c
mailing list