function - C declaration from standard signal Library -
so can explain supposed do:
void (*signal(int sig, void (*func)(int)) ) (int);
it definition taken standard signal library.
start name:
signal
go right far can:
signal(int sig, void (*func)(int))
you have parenthesized list of parameters, it's function taking 2 parameters: int
named sig
, function pointer named func
(you can analyze in same way later).
then hit rightparen, go left:
*signal(int sig, void (*func)(int))
so function signal
returns pointer to... something. let's take down parenthesis , go right again, since can:
(*signal(int sig, void (*func)(int)) ) (int)
we have again parenthesized list of arguments, signal
returns pointer function takes int
argument. go left again:
void (*signal(int sig, void (*func)(int)) ) (int)
thus function signal
returns pointer function taking int
, returning void
.
yes, language weird, @ least it's consistent. :)
Comments
Post a Comment