Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!caip!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!mhuxf!mhuxi!vax135!cjp From: cjp@vax135.UUCP (Charles Poirier) Newsgroups: net.micro.amiga Subject: Re: Lattice 3.02 Question (3.02) Message-ID: <1526@vax135.UUCP> Date: Mon, 4-Aug-86 21:34:46 EDT Article-I.D.: vax135.1526 Posted: Mon Aug 4 21:34:46 1986 Date-Received: Tue, 5-Aug-86 07:51:50 EDT References: <308@curly.ucla-cs.ARPA> Reply-To: cjp@vax135.UUCP (Charles Poirier) Organization: AT&T Bell Labs, Holmdel, NJ Lines: 15 Keywords: Lattice, bug In article <308@curly.ucla-cs.ARPA> sdk@zeus.UUCP (Scott D Kalter) writes: >The problem I am having is using a pointer to a function, for instance: >foo() { > printf("Hi\n"); } >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 */ >} I can't speak to Lattice, but in standard C you have declared a pointer to a function and assigned to it the address of a function, so use its contents like any other pointer: (*funptr)(); /* this should compile */