#include <iostream> #include <string.h> using namespace std; class String { public: String(const char * str=NULL) { if (str == NULL) { //这两行代码保证了: //任一String对象的m_string都不会是NULL,它指向heap上分配给它的空间 m_string = new char[1]; m_string = '