Why is the first element in an array always 0? -
i'm wondering thought of first element in array beingness 0 came from. why not 1? i've gotten used fact zero, cannot come reason first element zero.
an array block of sequential memory. if origin of array @ memory address x
, first element @ address x+0
, sec @ x+sizeof(arraytype)
, 3rd @ x+2*sizeof(arraytype)
, etc.
arrays
No comments:
Post a Comment