Maybe is a silly questiion, but I haven’t found a solution to what I want. Basically, I would like to declare a pointer to an array of pointers to function pointers to functions with N parameters that returns an const pointer to an int.
The code below is declaring an array of pointers to the function pointers:
int *const (**fptr[10])(...); // (const int* || int const*) != int *const
As you can see, the only thing is missing ( I think) is the pointer to the code from above.
I’m just a beginner and I’m not using this type of syntax in production, I’m just having fun while learning C++.
Thanks,
Armando.
The answer is multiple levels of typedefs to make this close to understandable. If you figure this out tonight, you’ll want to still be able to understand it in the morning.
Reading backwards can help you see what we’ve declared. Starting at the bottom right: We have “myMonstrosity” which a pointer to a myFuncPtrArray which is an array of 10 elements of myFuncPtr which is a function taking “…” pointer which returns a constant pointer to an integer.