Two Dimensional Arrays
In this lesson, an introduction of another type of Arrays known as two-dimensional Array is provided.
We'll cover the following
Apart from linear arrays, there is another type of array known as two dimensional array. Let’s discuss briefly about it.
What are two-dimensional arrays?
Unlike linear arrays, two-dimensional arrays are just like an m x n matrix with m number of rows and n number of columns.
Declaration
The declaration of 2-d arrays is as follows:
Datatype[m][n] name;
The elements in a two-dimensional array are arranged in the form of rows and columns.
Instantiation
The instantiation of a character array with 2 rows and 2 columns will be as:
Get hands-on with 1400+ tech skills courses.