Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!xanth!kremer From: kremer@cs.odu.edu (Lloyd Kremer) Newsgroups: comp.lang.c Subject: Re: Function pointers.. help! Summary: external declaration may be required Message-ID: <10183@xanth.cs.odu.edu> Date: 13 Oct 89 16:28:50 GMT References: <3005@ndsuvax.UUCP> Organization: Old Dominion University, Norfolk, Va. Lines: 34 In article <3005@ndsuvax.UUCP> nebakke@ndsuvax.UUCP (Jeff Bakke) writes: >say I have a function pointer defined: >void (*border_proc)(); >Ok, now I want a function to be called as >Assign_border(myfunction); >Where myfunction is a function name. >Now the assign_border function >is declared as >void Assign_border(void (*user_border)()){ > > border_proc = user_border; >} > >Now, to me, this seems alright, but to the Turbo c 2.0 compiler, it >says that a Storage class is required. The code seems basically all right. Maybe the Assign_border function doesn't know what border_proc is. This could be the case if border_proc's definition were in another file or occurred before the Assign_border function. Try extern void (*border_proc)(); /* extern could be the missing storage class */ border_proc = user_border; as the contents of Assign_border(). -- Lloyd Kremer ...!uunet!xanth!kremer Have terminal...will hack!