How calculate sum of values in std::vector<int>

Viewed 33942

Possible Duplicate:
sum of elements in a std::vector

I have std::vector<int> and I want to calculate the sum of all the values in that vector. Is there any built in function or I need to write my custom code?

3 Answers
Related