Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucsdhub!ucrmath!jantypas From: jantypas@ucrmath.UUCP (John Antypas) Newsgroups: comp.lang.c Subject: An array of function pointers. Message-ID: <414@ucrmath.UUCP> Date: 15 Sep 88 16:56:40 GMT Reply-To: jantypas@ucrmath.UUCP (John Antypas) Organization: University of California, Riverside Lines: 24 This may seem like a simple question but I've no luck with an answer so perhaps the net could help. In a graphics application we're writing at work, we have several functions for drawing lines, circles etc. We'd like to set up something like a vector table. If the vector table has a NULL in a spot, then the interpreter will use its internal routines instead of faster device specific code. As an example: vectors[] = { dev_line(), dev_box(), dev_circle(), dev_arc(), dev_text() } This says we have device specific code for all five functions. Yet when I try to copy function addresses, the compiler complains. How do I get the address of a funciton and put it into an array for calling later? Thanks. John Antypas -- Soft21 --21st Century Software: UUCP: {crash, garp, killer, pyramid, reed, ucsd!ucrmath}!soft21!jantypas Internet: jantypas%soft21.uucp@{garp.MIT.EDU, ucsd.EDU} Domains: jantypas@{soft21.Riverside.CA.US, soft21.CTS.COM}