Check out example codes for "passing an 2d array in cpp". It will help you in understanding the concepts better.

Code Example 1

Pass a pointer to a pointer

void processArr(int **a) {
   // Do Something
}
// When calling:
int **array;
array = new int *[10];
for(int i = 0; i <10; i++)
   array[i] = new int[10];
processArr(array);

Code Example 2

// The following program works only if your compiler is C99 compatible. 
#include <stdio.h> 
  
// n must be passed before the 2D array **important 
void print(int m, int n, int arr[][n]) 
{ 
    int i, j; 
    for (i = 0; i < m; i++) 
      for (j = 0; j < n; j++) 
        printf("%d ", arr[i][j]); 
} 
  
int main() 
{ 
    int arr[][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; 
    int m = 3, n = 3; 
    print(m, n, arr); 
    return 0; 
}

Learn ReactJs, React Native from akashmittal.com