here is a start. it copies standard input into a vector, sorts it, then copies the vector to standard output. this just uses a lexicographical string comparison.
#include <string>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
int main()
{
std::vector< std::string > v;
std::copy(std::istream_iterator< std::string >(std::cin), std::istream_iterator< std::string >(), std::back_insert_iterator< std::vector <std::string > >(v));
std::sort(v.begin(), v.end());
std::copy(v.begin(), v.end(), std::ostream_iterator< std::string >(std::cout, "\n"));
return 0;
}
a good place for you to begin would to be overriding the < operator for std::string.