Re: Function pointer prototype interpretation



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

cdecl> explain void(*(*foo)(int))(int,void(*)(int))
declare foo as pointer to function (int) returning pointer to function (int,
pointer to function (int) returning void) returning void

Source code for cdecl is available from
http://ftp.debian.org/debian/pool/main/c/cdecl/cdecl_2.5.orig.tar.gz

--
λz.λi.i(i((λn.λm.λz.λi.nz(λq.mqi))((λn.λz.λi.n(nzi)i)(λz.λi.i(((λn.λz.λi.n
(nzi)i)(λz.λi.i(iz)))zi)))((λn.λz.λi.n(nzi)i)(λz.λi.i(iz)))zi))
.



Relevant Pages

  • Re: confusion: casting function pointers
    ... pointer from the 'actual/other modules' that takes arguments of type ... list to types of void *). ... int main{ ... without a prototype, a number of special "promotion" rules take ...
    (comp.lang.c)
  • Re: invalid pointer adress
    ... >> pointer causes the program to exit with a core dump. ... struct s2{void *p;}; ... int leseExterneHinweise_masch_storno ... typedef struct s_AusdatFeldbeschreibung ...
    (comp.lang.c)
  • Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr?
    ... the destination pointer on user-space ... @src: ... const void *data, int bytelen); ...
    (Linux-Kernel)
  • Re: function pointer help!
    ... //the return void and input prameters are defined in the manual... ... void MyProjectView::CallHandler(int,unsigned int, unsigned int, void*) ... You are attempting to use a C++ member function as the callback, but the callback is defined in terms or C, not C++. ... The underlying problem is that C++ functions receive a hidden parameter, the 'this' pointer, so their signature is incompatible with C definitions. ...
    (microsoft.public.vc.mfc)
  • Re: Whats the meaning of this code
    ... void * work ... Whats the meaning of this line:- ... The meaning...a function called work that accepts a pointer of type ... pointer value is cast to an int value. ...
    (comp.lang.c)