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

Did you try cdecl?

[x0030819 asic Linux ~]: cdecl
Type `help' or `?' for help
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
cdecl> quit
[x0030819 asic Linux ~]:


Krishanu

.



Relevant Pages

  • Re: Please expplain this declaration
    ... I'm confused by the syntax - I have not seen a function pointer ... Find a copy of "cdecl" and run it against this signature. ... I get "declare getptr as function that expects (opcode as char) ... returning pointer to function that expects ...
    (comp.lang.c)
  • Re: Take and return pointer to function
    ... You've to come up with as complicated a function signature as you can, ... int Subtract; ... The programmable calculator queries a database looking for these 16 ... and receives a pointer to a 16-element-array of pointers to ...
    (comp.lang.c)
  • Re: Function pointer prototype interpretation
    ... > I came accross this FP signature and it has me baffled. ... declare foo as pointer to function returning pointer to function (int, ... pointer to function returning void) returning void ...
    (comp.lang.c)
  • Re: Warning on assigning a function-returning-a-pointer-to-arrays
    ... declare pfunc as function returning pointer to array 5 of int ... what cdecl does: http://ieng9.ucsd.edu/~cs30x/rt_lt.rule.html ... cdecl> declare p as function returning pointer to array 5 of int ...
    (comp.lang.c)
  • Re: printf() with too many args -- legal?
    ... the word "cdecl" refers to the program for turning C ... > declare foo as pointer to function returning int ... > cdecl> declare p as pointer to array 3 of pointer to function ...
    (comp.lang.c)