How do I find the size of a 2D array in C++? Is there any predefined function like sizeof to determine the size of the array?
sizeof
Also, can anyone tell me h
int arr[5][4];
For the row subscript(4 raise to 2, include cmath to use pow):
sizeof(arr1)/pow(4,2)
Column subscript:
sizeof(*arr1)/4
4 means 4 bytes, size of int.