A question about pointers to functions.

mikes at apple.UUCP mikes at apple.UUCP
Tue Jan 27 04:22:13 AEST 1987


Boy, I really dislike declaring an array of pointers-to-function
directly.  For things like that, I really like using typedefs, as in:

typedef int (*pfi)();		/* ptr to int */
extern int proc1(), proc2(), proc3();
pfi my_tab[] = {
	proc1,
	proc2,
	proc3
};


	Have you ever seen this one? 

typedef int IntFunc();	/* yes, this makes IntFunc a 'int function'!! */
typedef IntFunc *pfi;		/* makes pfi a 'pointer to a int function */
IntFunc proc1, proc2, proc3;
pfi my_tab[] = {
	proc1,
	proc2,
	proc3
};
-- 
			Michael Shannon {apple!mikes}



More information about the Comp.lang.c mailing list