(Sorry this is a sample quiz can't use typedef:P) I'm trying to write a declaration for the following function:
A function:
Accepts a pointer points to a function accepts a pointer to int and returns a pointer to int.
Returns a pointer to a function accepts int and returns int.
Here is my code:
int (* sigal(int *(*f)(int *)))(int);
However, this is a syntactical error. What's the right way to write it?
Edited:
The error seems to be there shouldn't be an f. I tried both my original code and
int (* sigal(int *(*)(int *)))(int);
on http://www.cdecl.org/. The later is passed.
Any explanation on what's the problem?
Update:
As 2501 said, the error seems to be a flavor of parser.
typedeffor pointer to function and then use it for function definition.