вот пример с использованием алгоритма :: sort
#include <algorithm>
#include <iostream>
struct Employee{
std::string s;
static bool comp(const Employee&e1, const Employee&e2){
return e1.s.compare(e2.s)<0;
}
};
int main(){
Employee arr[] = {
{"a"},
{"c"},
{"e"},
{"b"},
{"e"},
};
std::sort(std::begin(arr), std::end(arr), Employee::comp);
for(const auto& e: arr){
std::cout<<e.s<<std::endl;
}
//a
//b
//c
//e
//e
}
вот ссылка раздвоенной версии (не уверен, что она работает)