you could also use an algorithm and an iterator to print the vector instead of the for loop. then your code would not depend on an random access container.
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;
void main() {
string end = ("no");
string inser;
string lst;
vector<string> names;
do {
cout << "Enter as many names as you'd like." << endl;
cin >> inser;
names.push_back(inser);
cout << "Would you like to end?" << endl;
cin >> end;
cout << "Would you list to list the names?" << endl;
cin >> lst;
if (lst == ("yes")) {
copy(names.begin(), names.end(), ostream_iterator< string >(cout, "\n");
}
}
while (end != ("yes"));
}