class CStr { char *pData; int nLength; public: CStr(); // replace default constructor CStr(char *s); // typecasting constructor CStr(const CStr &str); // override default copy constructor ~CStr(); // override default destructor CStr& operator=(const CStr &source) // override default assignment { cpy(source.get()); return *this; } CStr& operator+=(CStr &str) { cat(str.get()); return *this; } CStr& operator+=(char *s) { cat(s); return *this; } operator const char*() {return get();} // conversion function char *get(void) const {return pData;} int getlength(void) const {return nLength;} void cpy(char *s); void cat(char *s); CStr friend operator+(CStr str1, CStr str2); /**** not needed because of CStr::CStr(Char *s) CStr friend operator+(char *s, CStr str); CStr friend operator+(CStr str, char *s); ****/ };