I figured it out.
It uses the same idea you mentioned anuode
For anyone else who wants to do this see:
http://www.cs.trinity.edu/~joldham0/...rint-sorted.cc
I couldn't get it to compile using this directly, I had to change the 'caseInsensitiveComp' function so it looked like this:
Code:
bool caseInsensitiveComp(string left, string right) {
// Convert the strings to all lowercase.
transform(left.begin(), left.end(), left.begin(), (int(*)(int))tolower);
transform(right.begin(), right.end(), right.begin(), (int(*)(int))tolower);
// Compare the strings.
return left < right; // string class has <
}
make sure you include <cctype> and <algorithm>
Hope this helps anyone else who has this problem.
Thanks,
Bendeco