Ambiguities are due to the fact that the pointer and the array are all different types. Therefore, the cast here is not suitable. Pointer to pointer and array of pointers, respectively, also different types. Need to change the func function.
In your case the following solutions are possible:
1. Function for a specific array (suitable if you have a function that only works with arrays of a certain and previously known size)
void func(int matrix[][10]);
2. Generalized pattern
template <size_t Size> void func(int matrix[][Size]);
But still, if you write in C ++, it is better to use the tools from the standard library. std::array almost as good as built-in arrays.
int (*)[], it is impossible to convertint [20][10]to this type, andint []is incomplete. Usestd::arrayor some class of matrices. - VTTfunc(int** array){}; funct(field);func(int** array){}; funct(field);- nick_n_a