ICSE Class 10 Computer Applications Question 7 of 59

Arrays — Question 7

Back to all questions
7
Question

Question 7

How is one-dimensional array represented in memory ?

Answer

Single-dimensional arrays are lists of information of the same type and their elements are stored in contiguous memory locations in their index order.

For example, an array grade of type char with 8 elements declared as

char grade[ ] = new char[8];

will have the element grade[0] at the first allocated memory location, grade[1] at the next contiguous memory location, grade[2] at the next, and so forth. Since grade is a char type array, each element size is 2 bytes and it will be represented in memory as shown in the figure given below:

How is one-dimensional array represented in memory? Arrays, Sumita Arora Computer Applications Solutions ICSE Class 10