How are elements of an array stored in memory?

1 answer

Answer

1276112

2026-08-11 16:45

+ Follow

Computer memory is linear so a one dimensional array can be mapped on to the memory cells in rather straight forward manner.To find the actual address of an element one needs to subtract one from the position of the desired entry and then add the result to the address of the the first cell in the sequence.Having said that therefore it is necessary to know the starting address of the space allocated to the array and the size of the each element, which is same for all the elements of an array.The the location of the Ith element would be B+I*S

where B is the base address(Starting address of the array) and S is the size of each element of the array.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.