class String { public: String(const char *str=NULL); String(const String &otherdata); ~String(void); String &operator=(const String &otherdata); outputString(); private: char *input_data; }; String::~String() { delete[]input_data;//destructor析构函数,释放地址空间 } String::(const String &otherdata) { assert(str!=NULL); if(str==NULL) { inputdata=new char[1]; *inputdata='\0'; } else { int length=strlen(otherdata.inputdata); inputdata=new char[length]; strcpy(inputdata,otherdata.inputdata); } } String::(const)