C++ 20
I have this function:
int (*funcArrayReturn())[6];
The function returns a pointer to an array int[6] (6 elements aggregated).
And I need a pointer of pointers of n elements(in this case 3) dynamically allocated like this:
int (*(*(*funcPtr2)[3])())[6];
C++ 20
int (*funcArrayReturn())[6]
{
int x[6];
int (*array_matrix_allocated)[6] = new int[1][6]{ 25 };
int number = array_matrix_allocated[0][0];
number = array_matrix_allocated[0][2];
return array_matrix_allocated;
}
I would dynamically allocate the pointer of this function with n elements
Pointer of pointers of 3 elements of functions with a return of a pointer of array int of n elements (6 in this case)
int (*(*(*funcPtr2)[3])())[6]` = new (int (*(*[10])[3]())[6]);)
(this is a wrong expression(10 elements)
Thank you