Check out example codes for "length of 2d array c++". It will help you in understanding the concepts better.

Code Example 1

int rows = sizeof(arr) / sizeof(arr[0]); // returns rows
int col = sizeof(arr[0]) / sizeof(int); // returns col

Learn ReactJs, React Native from akashmittal.com