Why is the first element of an array always 0?

advertisements

I'm wondering where the thought of the first element in an array being zero came from. Why is it not 1? I've gotten used to the fact that it is zero, but cannot come up with a reason for the first element to be zero.


An array is a block of sequential memory. If the beginning of the array is at memory address x, then the first element is at address x+0, the second is at x+sizeof(arraytype), the third is at x+2*sizeof(arraytype), etc.