how about using c_str() first and then using strcmp?
http://www.cppreference.com/cppstring/c_str.html
i quickly wrote something to test this myelf (hopefully this is the
correct way to do this):
#include <iostream>
#include <string>
using namespace std;
int main()
{
string test1 = "abcd";
string test2 = "AbCd";
cout << test1 << " " << test2 << " " << strcmp(test1.c_str(),
test2.c_str()) << endl;
test2 = "ABCD";
cout << test1 << " " << test2 << " " << strcmp(test1.c_str(),
test2.c_str()) << endl;
test2 = "abcd";
cout << test1 << " " << test2 << " " << strcmp(test1.c_str(),
test2.c_str()) << endl;
test2 = "dcba";
cout << test1 << " " << test2 << " " << strcmp(test1.c_str(),
test2.c_str()) << endl;
test2 = "abcdE";
cout << test1 << " " << test2 << " " << strcmp(test1.c_str(),
test2.c_str()) << endl;
return 0;
}
output
----------------------
abcd AbCd 1
abcd ABCD 1
abcd abcd 0
abcd dcba -1
abcd abcdE -1