Lets have an array of type int:-
int arr[5];
Now,
if arr[0] is at address 100 then
Why do we have;
arr[1] at address 102 ,
arr[2] at address 104 and so on.
Instead of
arr[1] at address 101 ,
arr[2] at address 102 and so on.
Is it because an integer takes 2 bytes?
Does each memory block has 1 Byte capacity (whether it is 32 bit processor or 64 bit)?
Your first example is consistent with 16-bit
ints.As to your second example (
&arr[0]==100,&arr[1]==101,&arr[2]==103), this can’t possibly be a valid layout since the distance between consecutive elements varies between the first pair and the second.