|
Not shown are two more variables. One would contain 5, since there are 5 elements in this array. Another would start out with 0, and would advance to 1, then 2, and so forth, up to 5. This variable is a counter and merely keeps track of how many numbers we have added up so that we don't go beyond the end of the array. After 8 is added into the sum, the pointer is advanced by 1 so that it points to the next element of the array:
|