I need to sort a CStringArray...
Does anyone know an algorithm that does this?
Thank you in advance!
Ronny
Printable View
I need to sort a CStringArray...
Does anyone know an algorithm that does this?
Thank you in advance!
Ronny
I have a Sort Class that will sort a CString array both a-z or z-a. Reply to this with your email address and I'll send you the code.
Cheers
Andy Pike
There is a Visual C++ KB article "How to Sort a CStringArray in MFC". Look for it in the KB.
Regards. Karl
my advise: use Standard C++ template library.
it would be as simple as
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<string> myarray;
myarray.push_back( "some string");
myarray.push_back( "some other string");
.
.
.
sort(myarray.begin(),myarray.end());
viola. you got a sorted array. with STL containers/algoritms you can do all sort of neat things.