0% found this document useful (0 votes)
6 views1 page

DS

The base address of an array is the memory location of its first element, and all elements of the array occupy the same amount of memory space. The memory address of any element can be calculated using the base address and the size of each element. For example, in an array with a base address of 10764H and element size of 2 bytes, the memory address of A[21] would be 10808H.

Uploaded by

vdcreation13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

DS

The base address of an array is the memory location of its first element, and all elements of the array occupy the same amount of memory space. The memory address of any element can be calculated using the base address and the size of each element. For example, in an array with a base address of 10764H and element size of 2 bytes, the memory address of A[21] would be 10808H.

Uploaded by

vdcreation13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Base address means the location of the first element of the array in the memory.

Memory address of any element implies the particular location in the memory where
the element is stored.

if your question is about memory address of the array , memory address and base
address of an array are the same thing. But if you are asking the memory address of
an element of an array then we can calculate the memory address of the element with
the help of base address.

An array is homogeneous data structure, which means we can store similar type of
data on a particular array. when we talk in terms of an array , it always implies
every element occupies same amount of memory space in the array. Every array is
identified with the help of base address of the array . So basically base address
helps in identifying the address of all the elements of the array.

if we consider an array A with n elements, size of each element of the array of y


bytes. Again if we consider the case when the array count start from 0 (as in the
case of C language) , then last element of the array is written as A[n-1] ( since
we start the array count from 0).

now coming back to memory address of an element, let us consider the element be in
the x location of the array.

A[x}= starting address of the array + (the number of elements prior to the element
x)*( size of each element)

if we suppose an array A containing 50 elements, starting address of the array is


10764H (H is for hexadecimal) and size of each element is 2 bytes, and we intend to
find the A[21] and we consider array count starts from 0. So to reach A[21] we need
to array count to be 22 (as we have started counting from 0 instead of 1)

A[21]= 10764+(22*2) =10764+44 = 10808H

if we know the memory location of a particular element we can directly go to that


location which is very helpful when we use pointer variable.

You might also like