Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: help with declaration Message-ID: <5997@brl-smoke.ARPA> Date: Thu, 18-Jun-87 21:14:49 EDT Article-I.D.: brl-smok.5997 Posted: Thu Jun 18 21:14:49 1987 Date-Received: Mon, 22-Jun-87 02:44:19 EDT References: <8286@ut-sally.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 Keywords: function pointer In article <8286@ut-sally.UUCP> atc@ut-sally.UUCP (Alvin T. Campbell III) writes: > int (*func)(); > func = getmenu(); > So how do I declare getmenu() ? As usual with C type declarations, all you need to do is declare the symbol in the proper context; since getmenu() has type equivalent to func, simply plug getmenu() in place of func in the declaration used for func: int (*getmenu())(); This is similar to the C library signal() function (which has void basic type instead of int). Since your example didn't use the int supposedly returned by (*func)(), perhaps you too should be using void not int.