Please, explain a bit more (great info so far)
My List Declaration :
list<Sstring *> theList; (in a class called Holder)
( Sstring is my own class containing a char * to an array )
-I don't care about the order of the old (unsorted) list.
-The order I need the list to be is alphabetical by the char * in each class.
So I can be able to do :
Code:
int main (void){
Holder h; //contains list
Sstring a("Axxx");
Sstring b("Bxxx");
Sstring c("Cxxx");
h.addMe(&c);
h.addMe(&b);
h.addMe(&a);
h.dsp_all();
h.MySort(); // sort funct to be here
h.dsp_all();
current output:
Cxxx
Bxxx
Axxx
WANTED OUTPUT
Axxx
Bxxx
Cxxx
So should I overload the < operator so i can say
" theList.sort(); " in the Holder::Mysort();