Path: utzoo!attcan!uunet!mcsun!cernvax!chx400!ethz!ethz-inf!mneerach From: mneerach@inf.ethz.ch (Matthias Ulrich Neeracher) Newsgroups: comp.lang.c Subject: Re: Type of function returning function. Message-ID: <29530@ethz-inf.UUCP> Date: 11 Jul 90 10:59:44 GMT References: <1990Jul10.024205.17382@media.uucp> Organization: Informatik ETH Zurich Lines: 31 In article <1990Jul10.024205.17382@media.uucp> rmf@media.uucp (Roger Fujii) writes: >So, just how does one type a function returning a pointer to a function? >(other than the obvious void *) >Example: >int foo(buff) >char *buff; >{ > return atoi(buff); >} > >TYPE bar() >{ > return foo; >} I always program things like this using an intermediate typedef : typedef int (*MyProcType)(); MyProcType bar() { return foo; } or more ANSI-like : typedef int (*MyProcType)(char); MyProcType bar() { return foo; } I don't know how to declare functions like this directly; I don't care. Why make you life unnecessarily hard ? Matthias