Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site molihp.UUCP Path: utzoo!utcsri!ubc-vision!molihp!martinl From: martinl@molihp.UUCP (Martin M Lacey) Newsgroups: net.lang.c Subject: Re: Pointers to Functions Message-ID: <135@molihp.UUCP> Date: Tue, 14-Jan-86 18:55:06 EST Article-I.D.: molihp.135 Posted: Tue Jan 14 18:55:06 1986 Date-Received: Wed, 15-Jan-86 08:46:38 EST References: <59@andromeda.UUCP> Reply-To: martinl@HP-UX.UUCP (Martin M Lacey) Organization: Moli Energy, Vancouver, B.C., CANADA Lines: 31 Summary: In article <59@andromeda.UUCP> dave@andromeda.UUCP (Dave Bloom) writes: ><> >Here's a good(?) question. Lets say I have this: > >main() >{ > int a(), b(); /* defined somewhere else */ > int (*c)(); /* a pointer to a function returning int (K&R pg141) */ > . > . > . > c = b; > (*c)(some arguments); >} > >Our compiler claims c is an "illegal function", > [...] >Looks like I'm missing something. Can anyone out the lend me a hand??? >What is it that's wrong in example one? How can I declare a generic pointer >to an int-function, set it equal to the address of a valid int function, >and use it instead of the function???? > >Thanx. >-- > Dave Bloom I have just tested the above on our system (Sys 5 rel 2: HP9000 series 500) and it works no problem. Your compiler is out-dated probably. Magic Martin.