int a[10];
- is laid out in memory as a contiguous block, as shown below:
One dimensional array storage pattern

Elements of array are stored in the successive increasing locations of memory. For example, if the array starts at memory location 0×1000, then with our assumed size of an integer (4 bytes), the first element is stored at location 0×1000, the second element at location 0×1004, and so on.
0 comments:
Post a Comment