// Here is a main function to test the string class #include "String.h" int main (void) { MyString str1; // call default constructor // MyString str2(); // Inproper form to call default constructor MyString str2; MyString str3('c'); MyString str4("hello"); MyString str5 = str4; // call copy constructor MyString str6(str4); cout << "The length of str1 is: " << str1.length() << endl; cout << "The length of str2 is: " << str2.length() << endl; cout << "The length of str3 is: " << str3.length() << endl; cout << "The length of str4 is: " << str4.length() << endl; cout << "The length of str5 is: " << str5.length() << endl; cout << "The length of str6 is: " << str6.length() << endl; cout << "str1 has "; str1.printStr(); cout << endl; cout << "str2 has "; str2.printStr(); cout << endl; cout << "str3 has "; str3.printStr(); cout << endl; cout << "str4 has "; str4.printStr(); cout << endl; cout << "str5 has "; str5.printStr(); cout << endl; cout << "str6 has "; str6.printStr(); cout << endl; }