0
Why we start the index of array from 0?
2 Respuestas
0
Edsger Dijkstra actually wrote a note in 1982 advocating for zero-based indexing. The difference between the upper & lower bound should be the length of the sequence. We have two choices for upper and lower bounds:
1 <= i < N+1 or 0 <= i < N. Clearly, putting N+1 in the range is ugly, so we should prefer indexing starting from 0.
0
0 is off set shown from the base address to first element........