Posts

Showing posts with the label Array

Array Basics

Image
Size of the array is fixed and can't be modified during runtime Arrays store data of specified type only Every cell has a unique index The index starts at 0.  Array elements are stored at contiguous memory locations in the array. Elements of all array types including linear, 2D, 3D, etc are stored in linear contiguous locations in memory. Suppose we want to go to a[6] i.e. seventh element and not 6th element, the computation is done internally as 0+6 i.e 6 elements after the first element, hence we get the seventh element. refToArray[x102] -------->[0][0][0][0]                                             here we get to the first element as x102 + 0                                                           ...