From b38346eebca9a007971af02fb3bb9472c5e16d0c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 26 Apr 2026 21:43:31 +0300 Subject: feat(Week09): Add solutions --- Week09/Exercise05/String.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Week09/Exercise05/String.h (limited to 'Week09/Exercise05/String.h') diff --git a/Week09/Exercise05/String.h b/Week09/Exercise05/String.h new file mode 100644 index 0000000..08c7a79 --- /dev/null +++ b/Week09/Exercise05/String.h @@ -0,0 +1,28 @@ +#ifndef _STRING +#define _STRING + +#include + +class String { + char* str; + unsigned length; + + void free(); + void copyFrom(const String& other); + +public: + String(); + ~String(); + String(const String& other); + String& operator=(const String& other); + + String(String&& other); + String& operator=(String&& other); + + String(unsigned length); + void Copy(const char* other); + + const char* GetStr() const; +}; + +#endif /* _STRING */ -- cgit v1.3.1-23-gd82d