# include <iostream> # include <memory> # include <cstring> using namespace std; class MyString { private: char *m_data; public: MyString(); MyString(const char* ptr); MyString(const MyString& rhs); ~MyString(); MyString& operator=(const MyString& rhs); MyString operator+(const MyString& rhs); char operator[](const unsigned int index); bool operator==(const MyString& rhs); friend ostream& operator<<(ostream& output, const MyString &rhs); }; //默认的构造函数 MyString::MyString() { m_data = new char[1]; *m_data = '