Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mcnc!spl From: spl@mcnc.org (Steve Lamont) Newsgroups: comp.lang.c Subject: Re: Solution of array of pointers to functions problem Message-ID: <4699@alvin.mcnc.org> Date: 14 Jun 89 12:37:23 GMT References: <823@helios.toronto.edu> Reply-To: spl@mcnc.org.UUCP (Steve Lamont) Distribution: na Organization: Microelectronics Center of NC; RTP, NC Lines: 59 In article <823@helios.toronto.edu> dooley@helios.physics.utoronto.ca (Kevin Dooley) writes: ...Assuming that you want to do something like <> <> double foo(); <> double bar(); <> double baz(); <> double woof(); <> double arf(); <> <> typedef double (*function)(); <> <> function functionList[] = { foo, bar, baz, woof, arf }; <> <>you can then invoke your favorite function in the following manner: <> <> someReturnValue = (*functionList[index])( your favorite args ); <