A simple function template
template<class T>
T sum(Vector<T>& v, int n)
{
T result = 0;
for (int i = 0; i < n; ++i)
result += v[n];
return result;
}
Previous slide
Next slide
Back to first slide
View graphic version