How to define a pointer to function that returns a pointer to function?
typedef int(*a)(int,int);
a (*b)(int,int);
Why this can work,but the following can’t work?
(int(*a)(int,int) ) (*b)(int,int);
or
int(*)(int,int) (*b)(int,int);
or
( int(*)(int,int) ) (*b)(int,int);
Here is the correct way to do it:
You can compile the following code that demonstrates using both of the methods. I would personally use the typedef method for clarity.