Xref: utzoo comp.lang.c:12245 comp.std.c:328 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ncar!dinl!noren From: noren@dinl.uucp (Charles Noren) Newsgroups: comp.lang.c,comp.std.c Subject: Re: Calling functions by address Keywords: functions calling Message-ID: <626@dinl.mmc.UUCP> Date: 30 Aug 88 21:58:40 GMT References: <679@mssx.UUCP> Reply-To: noren@dinl.UUCP (Charles Noren) Organization: Martin Marietta I&CS, Denver CO. Lines: 29 I'm not sure if I understand, but try something like this: typedef void (*func)() funcarray; void func1(), func2(), func3(),... /* Function Prototypes */ funcarray addressarray [] = { func1, func2, func3,... } ...and then execute this function to call function by address code: void execute (array, code) funcarray array[]; int code; { void (*function) (); function = array[code]; (*function)(); } ...the calling code would look like: execute (addressarray, code); I have not tried this, but I have used something very similar for implementing finite state machines using state/event matrices and it worked quite well. chuck