Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site hammer.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!vax135!cornell!uw-beaver!tektronix!orca!hammer!bradn From: bradn@hammer.UUCP (Brad Needham) Newsgroups: net.unix Subject: Re: functions returning pointers to functions Message-ID: <416@hammer.UUCP> Date: Tue, 13-Dec-83 17:13:37 EST Article-I.D.: hammer.416 Posted: Tue Dec 13 17:13:37 1983 Date-Received: Fri, 16-Dec-83 02:06:54 EST References: <2430@azure.UUCP> Organization: Tektronix, Wilsonville OR. Lines: 32 I think your confusion comes from the two ways of declaring a function: 1) with other declarations 2) with the function definition (i.e. the code for the function). Formal parameters do not appear when you declare a function separately from its definition, e.g. int *a(); vs int *a(x) int x; { ... } If you want a function returning a pointer to a function returning an int, you can say it two ways: 1) as a declaration: int (*getroutine())(); 2) or as a declaration and definition: int (*getroutine(name,table))() char *name; struct atable *table; { ... } Because the declaration of functions is so confusing, Graham Ross of Tektronix, MDP wrote a program to convert between English and C declarations. He posted it to net.sources quite a while ago, but I'm sure he can get a copy to you. He is tektronix!tekmdp!grahamr. Brad Needham Tektronix, ECS. ..decvax!tektronix!tekecs!bradn