pointers to functions

VLD/VMB gwyn at brl.arpa
Sun Jun 22 15:50:04 AEST 1986


Although many C implementations will allow one to store function
addresses in other types of pointers, such as (char *), it is not
guranteed.  Indeed, as I recall the latest X3J11 Draft it is not
guaranteed even for (void *), the "generic" object pointer type.

It is easy to get an array of function pointers.  Just declare them
properly (taking C operator precedence and associativity into account):

	void (*funcp[100])();	/* array of 100 ptrs to funcs */

	(*funcp[9])( args );	/* invokes the 10th function */



More information about the Comp.lang.c mailing list