TMI = Too Much Information.
The OP started out in another thread wanting to sum the elements in a C array, using a function. I provided some code there.
http://www.cplusplus.com/forum/beginner/252098/
Apparently he copy 'n' pasted the sample code I gave him there and layered on std::vector code for his code in this thread.
I saw immediately where he went wrong, and where he was going in the right direction. I deliberately created a couple of examples that pointed out two ways of doing things when dealing with std::vector, with "easy to notice" minimal changes.
Was it the best way to work with std:vector? No, but it was an introduction for what appears to be someone learning a new C++ concept.
I didn't want to scare him off by throwing too much "this is THE BEST WAY to do things" information at him right away. He can still learn more mature methods for using std::vector, hopefully eager to learn more. Either on his own, or here with code and questions.
You have a different teaching style from mine. I certainly wouldn't complain about your technique.
I prefer taking small steps that lead toward the big things, maybe inspiring questions along the way.