How can I declare f as pointer to function (pointer to pointer to integer, double) to return pointer to pointer to integer ?
I have tried a lot of variants including:
(int**)(f*)(int**,double)
(**int)(f*)(int**,double)
*(int)(f*)(int**,double)
How can I declare f as pointer to function (pointer to pointer to integer, double) to return pointer to pointer to integer ?
I have tried a lot of variants including:
(int**)(f*)(int**,double)
(**int)(f*)(int**,double)
*(int)(f*)(int**,double)
That would be:
int**(*f)(int**,double)
Which according to cdecl.org means:
declare f as pointer to function (pointer to pointer to int, double) returning pointer to pointer to int
I don't believe you can put parens around the return type, and the *
for the pointer-to-function part needs to be on the left of the declared name.
The function signature:
int** func(int**, double);
The function pointer declaration:
int** (*f)(int**, double);
Here's the answer :
int** (*f)(int**, double)
I read your description, broke it in parts and here it is:
int ** (*f)( int **, double)
^ ^ ^ ^
| | | |
| pointer to | |
| function | |
| | |
| pointer to |
| pointer to |
| integer |
| double
|
|
return pointer to pointer to integer
Its actually this simple.
You should read C FAQ on Declarations Its explains them in a very simple and comprehensive way.