Computer programming class Array index starts with what numb
Computer programming class
Array index starts with what number?
Explain this reason. Your explanation must include an equation to calculate the address of an element in an array.
Solution
An Array is a collection of similar data types. Arrays are declared as data type arrayName[array size]; The index of the array is used for sorting or locating any item in an array. The Array index strarts with 0. For example if the array contain 10 elements then the array starts from 0 to 9. The array index starts with 0 because array is a pointer which refers to memory location. The expression used to locate an element n-locations away from starting location is *(arr+n) or arr[n]. Here the indes is used as offset.