I was studying signal handling in unix and came across this
void (*signal(int sig, void (*func)(int)))(int);
I dont understand this prototype and how this returns a pointer to a function.
I also read this answer: How do function pointers in C work? but it's not clear to me.
It's supposed to return a function pointer but I dont understand where it specifies the return type as another function pointer.
The way I see it is that, if I use (*foo(int n))
in a function definition the return type of this function foo(int n)
becomes a function pointer.Is this correct?
Is there a simpler example for this?