I wanna sort a pointer vector with the algorithm "sort" in STL like
this:
"
int compare(vector< string*>::itera tor a,vector<string *>::iterator b){
return (**a)<(**b);
}
sort(iter,iter_ end,compare);
"
but this dosen't work,and I really don't know why.
Could anyone show me how to use this correctly?
this:
"
int compare(vector< string*>::itera tor a,vector<string *>::iterator b){
return (**a)<(**b);
}
sort(iter,iter_ end,compare);
"
but this dosen't work,and I really don't know why.
Could anyone show me how to use this correctly?
Comment