Copy assignment operator, the rule of three [on hold]
up vote
-2
down vote
favorite
Did I understand it right, that I need a copy assignment operator here according to the rule of three (https://en.cppreference.com/w/cpp/language/rule_of_three)? If yes, can I write it like this: mystring& operator=(mystring other) ? struct mystring { char *text; int len; mystring(const char *txt) { len=strlen(txt); text=new char[len+1]; strcpy(text,txt); } mystring(const mystring &s) { len=s.len; text=new char[len+1]; strcpy(text,s.text); } ~mystring() { delete text; } void append(const char*); char &at(int i) {return text[i];}; void print() {cout<<text<<endl;} }; void mystring::append(const char *txt) { char *tmp=new char[len+strlen(txt)+1]; strcpy...