Two-dimensional array

Describe the term two-dimensional array by using example?

E

Expert

Verified

The array with two dimensions is termed as a two-dimensional array. It is as well termed as a matrix. In C, a 2-dimensional array is initialized as int arr[nb_of_rows] [nb_of_columns]. Therefore, two dimensional arrays can be considered as grid. Element in a 2-dimensional can be accessed by illustrating its row and column. If array consists of 20 integer values, it will occupy 80 bytes in memory (supposing 4 bytes for an integer). All of the bytes are in consecutive memory positions, the first row occupying the first 20 bytes, the second the next 20 and so forth.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.