代码:
#include<iostream>
#include<string>
using namespace::std;
int main(void)
{
string str1 = ("abcccccdefg");
string str2 = ("abc");
char STR[7] = {0};
cout << (str1 > str2) << endl;//true or flase
cout << str1.compare(str2) << endl;
cout << str1.compare("asd") << endl;
cout << str1.compare(1,2,str2,1,2) << endl;
str1.copy(STR,5,6);
cout << STR << endl;
return 0;
}