Why is the first element in an array always 0? -


I am thinking that where the idea of ​​the first element in an array came from zero. Why is not this 1? I have used for the fact that it is zero, but the first element can not be due to being zero.

An array is a block of sequential memory if the array starts with memory address x , Then the first element is in the address x + 0 , the second is on the x + sizeof (arraytype) , the third x + 2 * sizeof (Arraytype) is on , etc.


Comments

Popular posts from this blog

c# - XML serialize base class without knowing derived class -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

udp - The relationship between MTU and size of skb in xmit function -