Declaring member variable of next element in a table
Posted on 1998-09-07
When declaring a function that works on a table of class instances, how can I declare a variable e.g. double length
from the next element in the table, so that when the function is working on the current element in the table, it can access the value of a member variable in the next element. For example, adding the lengths of array and array[i+1]for up to 10 elements.