Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
5.0k views
in Arrays and Structures by (49.1k points)
closed by

Explain memory representation of 2 – D array.

1 Answer

+1 vote
by (54.8k points)
selected by
 
Best answer

Normally, the two – dimensional array can be viewed as a matrix. The conceptual view of a 2 – D array is shown below:

int A[4][3];

A[0][0] A[0][1] A[0][2]
A[1][0] A[1][1] A[1][2]
A[2][0] A[2][1] A[2][2]
A[3][0] A[3][1] A[3][2]

In the above example, the 2 – D array name A has 4 rows and 3 columns.

Like one – dimensional, the 2 – D array elements are stored in continuous memory. There are two types of 2 – D array memory representations.

They are:

1. Row – Major order 

2. Column – Major order

For example

intA[4][3] = {

{8,6,5},

{2,1,9},

{3,6,4},

{4,3,2},

Row major:

Column major order

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...