#include <algorithm>
// ...
std::vector<std::string> vs; // assume it contains words
// ...
std::sort(vs.begin(), vs.end());
You shouldn't name your vector as "list" because there might be confusion between that and std::list, which is another container just like std::vector.