0
Why the array starts from 0 ?
please i am tired but not found any satusfied answer. help out me. !!
4 Respostas
+ 5
I guess because arr[i] means *(arr + sizeof(type) * index). So if you want to address the first element, i should be 0). Sorry if my notation is wrong or not understandable.
+ 1
It's because it's technically an offset in an array, due to the use of a pointer in the program to call on indices. So the nth index is '0' away from itself, and the 2nd index is 1 away, and so on. Think of it less as a number, and more as an offset(or relationship) from the start(the zeroth position).
0
That's just a rule like why 1=1... it needs to define rules to build something. Just take it like that, don't think about.
0
but there's a logic behind it .
i want that . :)