declaring and initializing an array of pointers to functions

gwyn%brl-vld at sri-unix.UUCP gwyn%brl-vld at sri-unix.UUCP
Tue Feb 21 16:08:15 AEST 1984


From:      Doug Gwyn (VLD/VMB) <gwyn at brl-vld>

typedef	int	valtype;		/* function return value type */

extern valtype	funca(), funcb(), ... funcz();	/* the functions */

static valtype	(*table[])() =		/* pointers to functions */
	{ funca, funcb, ... funcz };

...

	/* keyword # k has been recognized; call function */
	value = (*table[k])( args );

...



More information about the Comp.unix.wizards mailing list