So can someone explain what this is supposed to do:
void (*signal(int sig, void (*func)(int)) ) (int);
It is a definition taken from the st
The man page makes this declaration easier to understand by introducing a typedef
as:
typedef void (*sighandler_t)(int);
sighandler_t signal(int signum, sighandler_t handler);
sighandler_t
is defined as a pointer to a function that accepts an int
and returns void
.
signal
is a function that accepts an int
(signal number) and a function pointer and returns a function pointer.