Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!aplcen!uunet!mcsun!hp4nl!kunivv1!atcmpe!jc From: jc@atcmp.nl (Jan Christiaan van Winkel) Newsgroups: comp.lang.c Subject: Re: arrays of pointers to functions Message-ID: <595@atcmpe.atcmp.nl> Date: 4 May 90 19:04:20 GMT References: <3032@ultb.isc.rit.edu> Distribution: comp.lang.c Organization: AT Computing, Nijmegen, The Netherlands Lines: 21 From article <3032@ultb.isc.rit.edu>, by waw5805@ultb.isc.rit.edu (W.A. Willis): > I have the following declared: > > int (*func[])(); > > How do I go about initializing func so that it contains pointers to func0(), func1(), func2(), func3(); extern int func4(); func[1]=func1; func[2]=func2; func[3]=func3; func[4]=func4; and so on... This works, because the name of the function alone, without the function call operator () returns the address of the function. To call a function, retcal=(*func[0])(); JC. -- Jan Christiaan van Winkel Tel: +31 80 566880 jc@atcmp.nl AT Computing P.O. Box 1428 6501 BK Nijmegen The Netherlands