C++ Question

FlasHBurN

Golden Member
Oct 12, 1999
1,349
0
76
So I have a list of strings I want sorted alphabetically. Does anyone have a function to do this?
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
If you are using STL strings, I expect that the < operator is already overloaded appropriately. Just use the normal list sort method.
 

Dewey

Senior member
Mar 17, 2001
453
0
71
Did you try the sort method in list?

list<string> some_list;
some_list.sort ();
 

FlasHBurN

Golden Member
Oct 12, 1999
1,349
0
76
Originally posted by: Dewey
Did you try the sort method in list?

list<string> some_list;
some_list.sort ();


You know, I was in the middle of writing my own sort, when I realized that this existed, and of course works for what I need.