Why array index starts from 0[zero] only?

Showing Answers 1 - 11 of 11 Answers

sarika

  • Dec 13th, 2005
 

c,C++ compilers are build such that.so array index always starts with 0.

  Was this answer useful?  Yes

bsamar

  • Dec 21st, 2005
 

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.

Vincent

  • Aug 24th, 2006
 

because the name of an array is actually a pointer to the first element of this array in memory :array[0] is equivalent to *arrayarray[1] is equivalent to *(array + 1)...array[i] is equivalent to *(array + i)

  Was this answer useful?  Yes

Nisikant

  • Jan 30th, 2009
 

The array is terminated by a NULL character. Hence for array elements the space will be length-1. suppose you have 5 elements in an array. The last position is occupied by NULL character, then space available is 4. If the index will start from 1 then how can one store 5 elements. To over come this problems the array index starts from zero(0). It is a prorgamming technique of a programming language.

  Was this answer useful?  Yes

laxmanmanne

  • Jun 23rd, 2010
 

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.

  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