I have an assignment that is the following:
For a given integer array, find the sum of its elements and print out the final result, but to get the sum, you need to e
You're not constructing the vector right. The constructor that takes two integers is
vector(size_type _Count, const Type& _Val);
So _Count is 1 and _Value is an undefined value past the end of the array.