An amusing piece of code
Frank Adams
franka at mmintl.UUCP
Tue Apr 15 07:11:22 AEST 1986
In article <195 at desint.UUCP> geoff at desint.UUCP (Geoff Kuenning) writes:
> case B:
> B-code;
> goto common;
> case C:
> C-code;
> goto common;
> case D:
> D-code;
>common:
> BCD-common-code;
> break;
A quibble: I would put a goto common; between the D-code; and the common:.
That way, when someone maintaining the program adds a case F which wants to
execute the BCD-common-code, they can't accidently let D-code fall through to
F-code.
Frank Adams ihnp4!philabs!pwa-b!mmintl!franka
Multimate International 52 Oakland Ave North E. Hartford, CT 06108
More information about the Comp.lang.c
mailing list