What is the difference between a 2D array and an array of arrays?
I have read comments that seem to differentiate between the two:
int** arr = ...; cout << arr[i][j];This breaks if he’s using 2d arrays, or pointer-to-array types, rather than an array of arrays. – @Dave
See also: How do I use arrays in C++?
A 2 dimensional array is by definition an array of arrays.
What Dave was saying is that in that context, there are different semantics between the definition of a 2D array like this:
this:
or this: