just i want to know the reason....
why array index always starts with 0?
Collapse
X
-
SelesteenaTags: None -
Array indexes start with 0 because the name of the array is the address of the first element in the array.
So, the array name + 1 should be the second element.
That will only work if array name + 0 is the first element.
So then, array[0] is the first element and array[1] is the second element. -
prafi pancholi
because array pointer has set by default as 0 position and if any data put in to the array that the pointer automatically point that element as 0 addressed and then next it will increase by 1.
for ex. ptr=0(first value)
ptr=ptr+1Comment
Comment