// Test driver for simple String class #include "MyString.h" int main() { MyString s1 = "Hello, world"; cout << "s1 is:" << s1 << ", and s1.length() is " << s1.length() << endl; MyString s2 = " and goodbye"; cout << "s2 is:" << s2 << ", and s2.length() is " << s2.length() << endl; MyString s3 = s1 + s2; cout << "s3 is:" << s3 << ", and s3.length() is " << s3.length() << endl; s1 = s2; cout << "s1 is:" << s1 << ", and s1.length() is " << s1.length() << endl; s1 = "A completely new string"; cout << "s1 is:" << s1 << ", and s1.length() is " << s1.length() << endl; cout << "s2[3] is:" << s2[3] << endl; s2[3] = 'X'; cout << "s2 is:" << s2 << ", and s2.length() is " << s2.length() << endl; cout << "s2[-1] is:" << s2[-1] << endl; return 0; }