+ 1
Is there a specific reason for arrays to start at 0?
Why is it that arrays always start at 0? Is there a specific reason?
3 ответов
+ 2
Because the first address where the array starts in memory is where is the element is. So if you take the address of the whole array + 0, you get the first element stored in the array.
0
Well, kinda. The usual names for the states a single bit can have are usually called 0 and 1. So 0 is the smallest possible value.
There are programming languages that start at 1 though.
- 2
In programming zero doesn't mean nothing, it's a value . NULL is nothing .