F FlasHBurN Golden Member Oct 12, 1999 1,349 0 76 Aug 9, 2005 #1 So I have a list of strings I want sorted alphabetically. Does anyone have a function to do this?
sourceninja Diamond Member Mar 8, 2005 8,805 65 91 Aug 9, 2005 #2 http://www.google.com/search?hl=en&lr=&...t+of+strings+alphabetically+in+c%2B%2B
A Armitage Banned Feb 23, 2001 8,086 0 0 Aug 9, 2005 #3 If you are using STL strings, I expect that the < operator is already overloaded appropriately. Just use the normal list sort method.
If you are using STL strings, I expect that the < operator is already overloaded appropriately. Just use the normal list sort method.
D Dewey Senior member Mar 17, 2001 453 0 71 Aug 9, 2005 #4 Did you try the sort method in list? list<string> some_list; some_list.sort ();
X xtknight Elite Member Oct 15, 2004 12,974 0 71 Aug 9, 2005 #5 Search for a 'bubble sort'. That's what I've used anyway.
F FlasHBurN Golden Member Oct 12, 1999 1,349 0 76 Aug 9, 2005 #6 Originally posted by: Dewey Did you try the sort method in list? list<string> some_list; some_list.sort (); Click to expand... 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.
Originally posted by: Dewey Did you try the sort method in list? list<string> some_list; some_list.sort (); Click to expand... 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.