A question on Function declaration

brian_helterline brianh at hpcvia.CV.HP.COM
Thu Feb 14 04:13:38 AEST 1991


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.

	You need parenthesis around the '*' like this:
	(int (*)()) func();

-------------------------------------------------------------------------------
Brian Helterline     |                                | brianh at hpcvia.cv.HP.COM
Hewlett Packard      |       empty space here         | ..!hp-pcd!hpcvia!brianh
Corvallis, OR  97330 |         			      | 
-------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list