Nowadays , i was reading the APUE.and i found the function defined as below:
void (*signal(int signo, void (*func)(int)))(int);
i was confused,
The Clockwise Spiral rule will help: http://c-faq.com/decl/spiral.anderson.html
There are three simple steps to follow:
Starting with the unknown element, move in a spiral/clockwise direction; when ecountering the following elements replace them with the corresponding english statements:
[X] or [] => Array X size of... or Array undefined size of...
(type1, type2) => function passing type1 and type2 returning...
- => pointer(s) to...
Keep doing this in a spiral/clockwise direction until all tokens have been covered. Always resolve anything in parenthesis first!
See "Example #3: The 'Ultimate'", which is pretty much exactly what you are asking for:
"signal is a function passing an int and a pointer to a function passing an int returning nothing (void) returning a pointer to a function passing an int returning nothing (void)"