I saw this question in Baidu just now and answered it. This is a good question. Let's summarize it.
Declare a two-dimensional array
int matrix[100][100];
When two-dimensional arrays are passed as parameters, many people may write intfun (INT ** matrix) as soon as they come up ), in this way, there is no difference between "pointer to integer Pointer" and "pointer to integer array.
In this case, parameter passing is incorrect because Matrix is a two-dimensional array, and matrix [100] [100] is a two-dimensional array, that is, an array. That is to say, what is matrix? matrix is an array with 100 elements, but each element of matrix is an integer array instead of an integer number. This is why we should remember that "pointer to integer Pointer" is different from "pointer to integer array. Because of pointer operations, you must specify the size of the array pointed to by each element in the matrix when passing parameters. Otherwise, you cannot perform pointer operations. I * n + J, that is, you need to explain the N value. Otherwise, a blind multiplication of a number will definitely make an error.
Therefore, the two-dimensional array as a parameter should be written in int (* matrix) [100]. Note that the parentheses should not be dropped. If so, because [] has a higher priority *, therefore, matrix becomes a pointer to an integer pointer. So the correct function parameter should be written like this: int fun (INT (* matrix) [100]), just write it as fun (matrix) during the call!
Then you may have a question: why can one-dimensional array parameters be written as int fun (int * A), because it has the same meaning as a [n, all pointer to integer.