2. Since vectors are zero-based, the same with arrays, the last element is the std::vector::size - 1 element. Push back into the vector the last element, duplicating the last element.
Duplicating the last vector element can be achieved using std::vector::end member function. It returns an iterator referring to the past-the-end element in the vector container. http://www.cplusplus.com/reference/vector/vector/end/
Iterators are like pointers, you can use "pointer math" on the iterator. The last element in the vector is std::vector::end - 1.