The variable is declared in the scope as the type.
(1) The parameter is a two-dimensional array, but the dimension of the Second-dimensional must be specified.
Int array [10] [10];
Function declaration: void FUC (int A [] [10]);
Function call: FUC (array );
-- In function FUC, A is a two-dimensional array. Use a [I] [J] to access elements in the array.
(2) The parameter uses a one-dimensional pointer array.
Int * array [10];
For (I = 0; I <10; I ++)
Array [I] = new int [10];
Function declaration: void FUC (int * A [10]);
Function call: FUC (array );
-- In function FUC, A is a one-dimensional pointer array. Use * (a [I] + J) to access elements in the array.
(3) The parameter uses a pointer.
Int ** array;
Array = new int * [10];
For (I = 0; I <10; I ++)
Array [I] = new int [10];
Function declaration: void FUC (INT ** );
Function call: FUC (array );
-- In function FUC, A is a pointer. Use the * (int *) (a + I * D2 + J) form to access the elements in the array. Where:
A [0] <=> array [0] [0],
A [1] <=> array [0] [1],
...
A [10] <=> array [1] [0]
Note: D2 is the two-dimensional dimension of the Two-dimensional array, that is, the number of columns. And a + I * D2 + J is the address, so we need to forcibly convert the address of the pointer of this type to the pointer for use.