Greg Charles wrote:Something like
Actually, my suggestion would be:
What that does is to take an
array of (or several individual) values and calculate their sum; and it's properly
decoupled.
@Gary: What your method is doing is not summing, it's
accumulating; and that's very difficult to do in a loosely coupled way.
And, whatever you do decide on, don't forget that an
int that is the sum of several other
int's might overflow.
Winston