Two-dimensional array

Elucidate two-dimensional array?

E

Expert

Verified

An array with two dimensions is named as a two-dimensional array. It is also named as a matrix. In C, a two dimensional array is initialized as int arr[nb_of_rows] [nb_of_columns]. Thus, two dimensional arrays can be considered as grid. An element in two dimensional can be accessed through mentioning its row and column. If the array has 20 integer values, it will occupy 80 bytes in the memory (assuming 4 bytes for an integer). All of the bytes are in consecutive memory locations, the 1st row occupying the first 20 bytes, the 2nd the next 20, and so forth.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.