Re: Function pointer prototype interpretation
- From: "John Bode" <john_bode@xxxxxxxxxxx>
- Date: 30 Aug 2005 14:43:10 -0700
Alfonso Morra wrote:
> Hi all,
>
> I came accross this FP signature and it has me baffled.
>
> Can anyone explain this signature to me - i.e what are the input and
> output types ?
>
> void(*(*foo)(int))(int,void(*)(int))
>
> Thanks
foo -- foo
*foo -- is a pointer
(*foo)() -- to a function
(*foo)(int) -- taking one int parameter
*(*foo)(int) -- returning a pointer
(*(*foo)(int))() -- to a function
(*(*foo)(int))(int, void(*)(int)) -- taking two parameters,
one int and the other
a pointer to a function
taking one int parameter
and returning void
void (*(*foo)(int))(int, void(*)(int)) -- returning void
To summarize, foo is a pointer to a function that returns a pointer to
a function that returns void.
.
- Follow-Ups:
- Re: Function pointer prototype interpretation
- From: Alfonso Morra
- Re: Function pointer prototype interpretation
- References:
- Function pointer prototype interpretation
- From: Alfonso Morra
- Function pointer prototype interpretation
- Prev by Date: Re: while (1) vs. for ( ;; )
- Next by Date: Re: Why C/C++ errors are SO obscure/devious??
- Previous by thread: Re: Function pointer prototype interpretation
- Next by thread: Re: Function pointer prototype interpretation
- Index(es):
Relevant Pages
|