A question on Function declaration
Jeff Newberry
newberry at nmsu.edu
Thu Feb 14 03:27:57 AEST 1991
>I would like to declare a function which returns a pointer to a function
>(that returns an integer). I have been unable to strike at the correct
>syntax of such a declaration.
>
>I tried the following (among others):
> ((int *)()) func() ;
>
>Doesn't work.
>
>Thanks for any hints/answers.
I believe the following should work...
typedef int (*PFI)(); /* type PFI = pointer to a function that returns int */
PFI func();
{
...
}
Jeff Newberry
More information about the Comp.lang.c
mailing list