Seven Original Sins of K&R (Long)

gillies at m.cs.uiuc.edu gillies at m.cs.uiuc.edu
Wed Sep 26 11:20:00 AEST 1990


Re: Sin #IV

Hey, how else can I write the following amazingly convoluted code
(idea courtest of Harbison & Steele's book, first edition):

main()
{
int x,i;
x=1;
switch(x) {
	case 1:
		for (i=0; i < 10; i++)
	case 2:
		printf("%d ",i);
}
}

And the result:

0 1 2 3 4 5 6 7 8 9



More information about the Comp.lang.c mailing list