On Wed, 13 Dec 2006 16:33:47 +0100, Till Backhaus <>
wrote in comp.lang.c:
> Hi comp.lang.c,
>
> sorry for the subject of this message not being valid c, anyway this
> is the shortest and cleanest way to describe my problem.
> To put in other words:
> I'm searching for a way to declare functions that return function
> pointers of it's own type.
> (Yes, I know of void-pointers, I just don't wan't loose type-checking if
> I don't have to.)
>
> Cheers,
> Till Backhaus
Can't be done directly. Can be done using a structure with a function
pointer as its only member. Return an instance of the structure.
Coding is rather icky and left as an exercise to the reader, with the
hint that typedef comes in handy.
See
http://c-faq.com/decl/recurfuncp.html in the FAQ, how did you miss
it?
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://c-faq.com/
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html