运算符重载
class Mystring{public:
Mystring(char *s = "", int length = 32);
Mystring(char ch);
Mystring(Mystring &str);
~Mystring();
void insert(int i, Mystring &str);
void insert(int i,char ch);
void reverse();
char& operator[](int i);
void operator+=(Mystring &str);
int count();
friend ostream& operator<<(ostream&out, Mystring &str)
{
out << "\"" << str.element << "\"";
return out;
}
private:
char *element;
int length;
int n;
void init(char *s = "", int length = 32);
};
如何重载void operator+=(Mystring &str);//Mystring+char@小甲鱼
@阴影中的曙光 面向对象....爱莫能助啊...{:10_266:}
页:
[1]