Ask Question
17 August, 05:58

Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long

+3
Answers (1)
  1. 17 August, 06:52
    0
    Array is collection of similar data types it is a linear data structure. Array stores elements in a contiguous memory location.

    We have an array arr[5] of size 5 and it is of integer type. Suppose the starting address of the array is 2000 and each memory location is one byte long. As we know that the size of integer is 2 or 4 bytes we take it 2 bytes.

    If the starting address is 2000 that is of index 0 then the address of index 1 is 2000+2=2002.

    address of index 2=2004.

    address of index 3=2006.

    address of index 4=2008.

    Since size of int is 2 bytes hence we add two memory location.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers