well you have already used the member function begin(). there is also a member function.called end() which returns a pointer one.past the last element. or there is size(). just use one of those as a stop condition. if you want to check out what member functions vector has.google vector c++ and click on the reference.