Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site jc3b21.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!akguc!codas!peora!ucf-cs!usfvax2!3b2bame!jc3b21!larry From: larry@jc3b21.UUCP (Lawrence F. Strickland) Newsgroups: net.lang.c Subject: Re: Pointer to function Message-ID: <136@jc3b21.UUCP> Date: Tue, 14-Jan-86 16:06:50 EST Article-I.D.: jc3b21.136 Posted: Tue Jan 14 16:06:50 1986 Date-Received: Fri, 17-Jan-86 06:03:05 EST Organization: St. Petersburg Jr. College, FL Lines: 44 In the article headed: From: dave@andromeda.UUCP (Dave Bloom) Newsgroups: net.lang.c Subject: Pointers to Functions Message-ID: <59@andromeda.UUCP> Date: Thu, 9-Jan-86 13:46:33 EST Dave Bloom says: > > 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???? > The above program compiles correctly on a 3b2 Computer running under System V.2. Apparently, the problem is with the compiler used! What are the results on other compilers out there? Mail to me and I will summarize and post. -----Larry Strickland St. Petersburg Jr. College P.O. Box 13489 St. Petersburg, FL 33733 UseNet: ...akgua!akguc!codas!peora!ucf-cs!usfvax2!3b2bame!jc3b21!larry