Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site andromeda.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!uwvax!topaz!andromeda!dave 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 Article-I.D.: andromed.59 Posted: Thu Jan 9 13:46:33 1986 Date-Received: Sat, 11-Jan-86 05:40:25 EST Organization: Rutgers University, Newark, N.J. Lines: 44 <> 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", yet the following it permits: main() { int a(), b(); a(b); } a(x) int (*x)(); { (*x)(some arguments); } 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. -- ------------------------------------------------------------------------------- allegra\ Dave Bloom harvard \ pyramid\ seismo \ pyrnj >!andromeda!dave HOME: (201) 868-1764 ut-sally >!topaz/ WORK: (201) 648-5083 sri-iu / ihnp4!packard / "You're never alone with a schizophrenic...."