Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ogccse!blake!ndsuvax!nebakke From: nebakke@ndsuvax.UUCP (Jeff Bakke) Newsgroups: comp.graphics Subject: Function pointer help Message-ID: <3003@ndsuvax.UUCP> Date: 13 Oct 89 07:02:03 GMT Reply-To: nebakke@ndsuvax.UUCP (Jeff Bakke) Distribution: comp.lang.c Organization: North Dakota State University, Fargo Lines: 35 I have been working with function pointers in a program of mine and have run into a stumper. Maybe I'm just not reading the manuals correctly but what syntax do I use for the following setup: /* declaration */ void (*border)(); /* a function pointer to a window border function */ ... void set_user_border(void *user_border){ border = user_border; } Now the problem occurs when I compile in that it returns an error (turbo c 2.0 by the way) stating that I need a storage type or something like that. What I'm trying to do, is set border to point to a user defined border function that is created outside of the library. The user would call the function as: set_user_border(myfunction); And then supposedly border would then point to myfunction. Somehow I get the feeling that I'm setting up the parameter wrong but I don't know what the correct declaration is. I've tried (void (*user_border)()) but that still crashes. Could someone point me in the right direction. Thanks for the help. Jeff bakke nebakke@plains.nodak.edu nu113738@ndsuvm1.bitnet