WHY ARRAY INDEX STARTS FROM ZERO?

James Smith

Total Post:79

Points:395
Posted by  James Smith
 1888  View(s)
Ratings:
Rate this:
  1. James Smith

    Post:79

    Points:395
    Why Array Index starts from Zero?

    This boils down to the concept of Binary digits. Take an array size of 64 for example. We start from 0 and end at 63. We require 6 bits.But, if we were to start from 1 and end at 64, we would require 7 bits to store the same number, thus increasing the storage size.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!