Well, you can understand it as follows:
A 2-D array looks like a grid with row and columns to represent a person, but in memory it is stored in continuous memory. Therefore, whenever you say a two-dimensional array or size mxn , you are talking about m arrays of elements n , each of which is stored one after another. that is, for 3x3 grid elements, they are saved as:
(0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) (2,2)
If you want to access such a data structure, you need to use a pointer to a pointer, that is, a pointer to an array of location addresses of the first element of each row.
Thus, access to the array can be obtained using address 3 (number of rows)
(Address of element 0,1) (Address of element 1,0) (Address of element 2,0)
Since the address of the elements is stored like this now, you need a pointer to a pointer to access this array of pointers (by holding the addresses of the first element of each row).
For 1D array:
int* pointer = new int[3]; Array: (0) (1) (2) pointer: (Address of first element of Array)
For a two-dimensional array:
int **pointer = new int[3][3]; Array: (0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) (2,2) Row Address Array: (Address of 0,1) (Address of 1,0) (Address of 2,0) pointer: (Address of first element of Row Address Array)
Hope this helps!