valentines-day-acrostic.pdf File Size: 612.73 KB: File Type: pdf: Created On: 01/12/2009 : Downloads: 12161 Downloads
Following is an example to assign a single element of the array: The above statement assigns element number 5th in the array with a value of 50.0. All arrays have 0 as the index of their first element which is also called base index and last index of an array will be total size of the array minus 1. Following is the pictorial representation of the same array we discussed above:
Array elements are counted from 0 and not 1. The first elements will always have position and index 0 and the last element will have index number (position) N-1 if the array has N elements. The first elements in the arrays declared above are referred to by position[0], count[0] and YourSurname[0] respectively. The last element of an array declared as array[N] with N elements is referred to by array[N-1]. The last elements of the example arrays above are therefore referred to by position[2], count[99] and YourSurname[49] respectively.