#include #include using namespace std; int main() { string Hand = "Have a nice day"; string hand = "have a nice day"; string Have = "Have"; string nice = "nice"; cout << Hand.compare(Hand) << endl; cout << Hand.compare(hand) << endl; cout << Hand.compare(Have) << endl; cout << string("ABC").compare("ABD") << endl; cout << Hand.compare(7,4,nice) << endl; cout << Hand.compare(1,string::npos,hand,1,string::npos) << endl; cout << Have.compare(Have.c_str()) << endl << endl; char array[16]; Hand.copy(array,4); cout << array << endl; cout << Hand.substr(5) << endl; cout << Hand.substr(5,6) << endl; }