A question on Function declaration

Stephen Shortland sland at motcid.UUCP
Wed Feb 13 20:36:33 AEST 1991


joshi at motcid.UUCP (Abhay B. Joshi) writes:

>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.

Have you tried:

        int (*func())()
 
I think that this should do what you want.

-- 
| Stephen Shortland,      | Motorola Ireland Ltd,    |                      |
|                         | Mahon Industrial Estate, |                      |
| Phone +353-21-357101    | Blackrock, Cork,         | ..uunet!motcid!sland |
| Fax.  +353-21-357635    | IRELAND.                 |                      |



More information about the Comp.lang.c mailing list