B
bartc
I don't know the spec of signal(), but an array of pointers to a function
taking two ints and returning a pointer to a double, might be:
I found this:
void ( * signal(int, void (*)(int)))(int)
which with the help of cdecl (which was itself a job and a half to track
down a working copy) told me this:
"declare signal as function (int, pointer to function (int) returning void)
returning pointer to function (int) returning void"
In the suggested syntax it can be written as:
function (int, *function(int)void ) *function(int)void
The name "signal" can either go after the first "function" (to be in line
with how ordinary functions are defined) or at the end (the same as how
variables might be defined); either way, it's at one end or the other, not
buried in the middle:
function signal(int, *function(int)void ) *function(int)void {...}
function (int, *function(int)void ) *function(int)void signal;
If that's still too cryptic then * can also be optionally written as
"pointer to", and "returning" can be optionally added after the ")", so that
it looks like:
function (int, pointer to function(int) returning void ) returning pointer
to function(int) returning void
It is now identical to the main part of the cdecl output.