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
0 votes
6.3k views
in Computer by (69.2k points)

Consider a 2D array as char A[5] [6] stored in contiguous memory locations starting from location 1000” in column major order. What would the address of a[i] [d]? 

1 Answer

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

Considering the given char array A[5][6] stored in contiguous memory in column major order; the address of a[i] [d] would be calculated as base (a) + (d*n1 +i) * size ; where base(a) =1000 (given).

Since it is a char array so size=1 and n1 is the total no of rows here n1=6 (0,1,2,3,4,5,) Substituting values we get the address of A[i] [d] = 1000 + d*6 + i 

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.

Categories

...