void fnc( int ** arr) { }
int main()
{
int arr[2][3];
fnc( arr );
}
Here the compiler error:
1 2 3 4 5 6 7
error: no matching function for call to 'fnc'
fnc( arr );
^~~
arrtest.cpp:1:6: note: candidate function not viable: no known conversion from
'int [2][3]' to 'int **'for 1st argument
void fnc( int ** arr) { }
^
But I thought, an array will be passed as pointer. Why doesn't match this pointer to the array signature? And how need I cast the argument at the function call?
Yes, a cast to 'int**' works. But i thought, int[][] and int** would be the same thing for a function signature, because the int[][] will implicitly convertet to int** inside the function. I wonder why this isn't so.