Arrays 2D Lecture 17
Arrays 2D Lecture 17
Arrays 2D Lecture 17
Column subscript
Array name
Row subscript
4
©LPU CSE101 C Programming
Memory representation of 2D-Array
• A 2D array’s elements are stored in continuous memory locations. It can
be represented in memory using any of the following two ways:
1. Column-Major Order
2. Row-Major Order
1. Column-Major Order:
In this method the elements are stored column wise, i.e. m elements of
first column are stored in first m locations, m elements of second column
are stored in next m locations and so on. E.g.
A 3 x 4 array will stored as below: