|
-
March 30th, 1999, 08:13 AM
#1
Sort a CStringArray
I need to sort a CStringArray...
Does anyone know an algorithm that does this?
Thank you in advance!
Ronny
-
March 30th, 1999, 08:50 AM
#2
Re: Sort a CStringArray
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
-
March 30th, 1999, 04:11 PM
#3
Re: Sort a CStringArray
There is a Visual C++ KB article "How to Sort a CStringArray in MFC". Look for it in the KB.
Regards. Karl
-
March 30th, 1999, 10:55 PM
#4
Re: Sort a CStringArray
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|