Computer Science, asked by robinrobin7478, 23 hours ago

Examine the organization of arrays inside the memory​

Answers

Answered by ppppranto152gmailcom
1

Answer:

Arrays are often represented with diagrams that represent their memory use. ... Pointers hold the memory address of other data and are represented by a black disk with an arrow pointing to the data it references. The actual array variable, a in this example, is a pointer to the memory for all of its elements.

Answered by rakhijain992626
0

Answer:

How is memory organized for an array?

An estimate is made as to the memory footprint of a single element in the array,

and then multiplied by the initial capacity of the array as defined.

The layout is then end-to-end linear — that is each chunk of memory the size of the type of object are adjacent. There are no breaks or other things in between the data chunks; it is one contiguous (no gap) memory block of data.

Most all modern computers are byte-addressable meaning you can address a single byte of memory with an address. An address itself may take 4 or 8 bytes to store, but it still is the address of one byte. So the convention is to start the address of a type at the MSB ( most significant byte) of the type as stored in memory.

Explanation:

Most languages that allow direct memory access ( hardware-facing languages)

store structures on byte boundaries of the word size of the machine (32 or 64 bits). So even though you may have two arrays defined right next to each other in source, the arrays are not directly adjacent. There will be some unused padding addresses in between them with either junk, or unaccessible memory in them.

Similar questions