Declaration of 2D-Arrays in C++

To declare the array, we use double pair of opening and closing square bracket.

Declaration statement:

DataType  NameOfArray[Rows][Columns];

Eg; int a[3][5];

This declaration creates 3 rows and each row has 5 elements.

No comments:

Post a Comment