djsfantasi
- Joined Apr 11, 2010
- 9,163
Note that in sagor’s reply, if A[ ] has a dimension of 10, it’s last element is A[9]. This can be confusing. Remember that when an array is used, it’s indices always start at 0. Thus, for n (eg 10) elements, the last element will always be n-1 (eg 9). Also remember that the first element will always be A[0].