Why does an array index number starts from zero?

Showing Answers 1 - 1 of 1 Answers

Nikhil

  • Jul 23rd, 2007
 

Because array index shows distance from the 1st element. Since the first element is zero distance away from itself, index starts from zero. The next element will be "index*scaling factor" distance away from 1st element. In case of integer array next elements will be  1*2, 2*2, 3*2, 4*2, .................bytes  away from the first element .

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions