Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site blnt1.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!whuxcc!lcuxlm!akgua!sb6!scbhq!uahcs1!madhat!blnt1!jat From: jat@blnt1.UUCP Newsgroups: net.micro.amiga Subject: Re: Lattice 3.02 Question (3.02) Message-ID: <116@blnt1.UUCP> Date: Wed, 6-Aug-86 09:22:58 EDT Article-I.D.: blnt1.116 Posted: Wed Aug 6 09:22:58 1986 Date-Received: Sun, 10-Aug-86 05:06:43 EDT References: <308@curly.ucla-cs.ARPA> Reply-To: jat@blnt1.UUCP (John A Tamplin) Organization: Blount Brothers Corp., Montgomery AL Lines: 25 Keywords: Lattice, bug In article <308@curly.ucla-cs.ARPA> sdk@zeus.UUCP (Scott D Kalter) writes: >bar() { > int (*funptr)(); /* I believe this is the correct declaration */ > > funptr = foo; /* this line compiles without error */ > funptr(); /* this line generates an ERROR so no quad file is made */ >} The correct syntax for calling a function through a pointer is: bar() { int (*funptr)(); funptr=foo; (*funptr)(); } funptr is a pointer to a function returning integer, so *funptr is a function returning integer. The parentheses are necessary because () binds more tightly that does *. John Tamplin Blount Brothers Corporation akgua!blnt1!jat 2511 Fairlane Drive 205/244-6231 Montgomery, AL 36116