mildly obfuscating c

daemon at houligan.UUCP daemon at houligan.UUCP
Wed Dec 18 07:07:19 AEST 1985


> i haven't been able to figure out anyway to "goto" a label that
> i don't know.  for example, i would like to do this:
>
> -------------------------------------------------------------
> main() {
> 	int (*jump[])() = { l1,l2,l3,l4,l5,l6,l7,l8 }
>
> 	l1: /* code */
> 	l2: /* code */
> 	l3: /* code */
> 	l4: /* code */
> 	l5: /* code */
> 	l6: /* code */
> 	l7: /* code */
> 	l8: /* code */
>
> 	goto *jump[whatever]
> }
> -------------------------------------------------------------
>
> aside from the forward-referencing problem of the unseen labels,
> this is a still syntax error.   anyone have any way to do this?

The simplest method to accomplish this is the "switch" statement.
--tgi
	while (--tgi)	/* my mind continues to decay */
		;	/* even though I do nothing.. */    

{brl-bmd,ccvaxa,pur-ee,sun}!csd-gould!midas!tgi (Craig Strickland @ Gould)
305/587-2900 x5014  CompuServe: 76545,1007   Source: BDQ615   MCIMail: 272-3350



More information about the Comp.lang.c mailing list