Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!husc6!sri-unix!sri-spam!ames!lll-lcc!pyramid!voder!apple!mikes From: mikes@apple.UUCP Newsgroups: comp.lang.c Subject: Re: A question about pointers to functions. Message-ID: <403@apple.UUCP> Date: Mon, 26-Jan-87 13:22:13 EST Article-I.D.: apple.403 Posted: Mon Jan 26 13:22:13 1987 Date-Received: Tue, 27-Jan-87 06:01:03 EST References: <3460@amd.UUCP> <1508@cit-vax.Caltech.Edu> <118@ems.UUCP> Reply-To: mikes@apple.UUCP (Mike Shannon) Organization: Apple Computer Inc., Cupertino, USA Lines: 24 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}