1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class DynStr { char* str; int length; void free(); void copyFrom(const DynStr& other); public: DynStr(); DynStr(const char* str); DynStr(const DynStr& copy); DynStr& operator=(const DynStr& other); ~DynStr(); const char* get_str() const; int compare(const char* other) const; };