I was asked about this today. In practice, I rarely use 2-dimensional array, instead I use vector of vectors. To allocate a 2-d array on the stack, a C-style array is int d[2][3]; Then to refer to an element it is like d[i][j]; To make a dynamical allocation, one can NOT write his code like […]