c++ vector remove last item code example Example: remove the last element of a vector in cpp vectorname.pop_back();