// Test driver for simple String class #include "MyString.h" #include int main() { MyString s1 = "Hello, world"; cout << "s1 is:<" << s1 << ">, s1.length() is " << s1.length() << endl; MyString s2 = "and goodbye"; cout << "s2 is:<" << s2 << ">, s2.length() is " << s2.length() << endl; MyString s3 = s1 + " " + s2; cout << "s3 is:<" << s3 << ">, s3.length() is " << s3.length() << endl; s1 = s1(7, 5); cout << "Now s1 is:<" << s1 << ">, s1.length() is " << s1.length() << endl; if (s1 < s2) cout << "s1 comes first" << endl; else cout << "s2 comes first" << endl; s1[0] = toupper(s1[0]); cout << "And now s1 is:<" << s1 << ">, s1.length() is " << s1.length() << endl; if (s1 < s2) cout << "Now s1 comes first" << endl; else cout << "Now s2 comes first" << endl; s3 += ' '; cout << "Now s3 is:<" << s3 << ">, s3.length() is " << s3.length() << endl; s3 += "for now..."; cout << "Now s3 is:<" << s3 << ">, s3.length() is " << s3.length() << endl; return 0; }