What are 2-Dimensional Arrays?

A 2-Dimensional(2D) Array is an array of arrays i.e, it is a collection of 1-dimensional arrays. In other words, it is an array where each member of the array is also an array.

In C++, the row and column number starts from 0 by default. If  a 2D Array is defined in C++ with 'i' rows and 'j' columns, then the row number starts from 0 and ends with (i-1) and column number starts from 0 and ends with (j-1). The last row would be (i-1)th row and the last column would be (j-1)th column. 

No comments:

Post a Comment