Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!know!samsung!munnari.oz.au!csource!david From: david@csource.oz.au (david nugent) Newsgroups: comp.lang.c Subject: Re: Type of function returning function. Message-ID: <562@csource.oz.au> Date: 12 Jul 90 15:15:24 GMT References: <1990Jul10.024205.17382@media.uucp> Organization: Unique Computing Pty Ltd, Melb, Aust. Lines: 33 In <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 would have thought that it would be something like >int ((*)()), but gcc doesn't agree. Help... Believe it or not (it looks quite strange): int (*bar (void))() { return foo; } -- _______________________________________________________________________________ Unique Computing Pty Ltd Melbourne Australia - Communications Specialists david@csource.oz.au 3:632/348@fidonet 28:4100/1@signet