Check out example codes for "how to make a n*n 2d dynamic array in c++". It will help you in understanding the concepts better.
Code Example 1
int** a = new int*[rowCount]; for(int i = 0; i < rowCount; ++i) a[i] = new int[colCount];
Learn ReactJs, React Native from akashmittal.com