// Program file: strcomp2.cpp /* This program uses the string class extension, not 'char' arrays */ #include #include using namespace std; int main() { string name1, name2, name3; system("cls"); cout << "Enter the first name: "; cin >> name1; cout << "Enter the second name: "; cin >> name2; cout << name1 << " " << name2 << " " << name3 << endl; if (name1 == name2) cout << "Strings equal" << endl; else if (name1 > name2) cout << "name1 is greater than name2" << endl; else cout << "name1 is less than name2" << endl; name3 = name1; if (name3 == name1) cout << "name3 is equal to name1" << endl; else cout << "name3 is not equal to name1" << endl; name3.append(" "); name3.append(name2); cout << name3 << " " << name3.size() << endl; system("pause"); return 0; }