From e5c06fbc864205a9736f07f9237ace80617ca471 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 16 Mar 2026 22:41:31 +0200 Subject: feat(Week04): Add solutions --- Week04/Exercise03/String.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Week04/Exercise03/String.h (limited to 'Week04/Exercise03/String.h') diff --git a/Week04/Exercise03/String.h b/Week04/Exercise03/String.h new file mode 100644 index 0000000..e7d1983 --- /dev/null +++ b/Week04/Exercise03/String.h @@ -0,0 +1,25 @@ +#ifndef _STRING +#define _STRING + +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(const char* str); + + unsigned GetLength(); + const char* GetStr(); + + String Substring(unsigned startIndex, unsigned endIndex); + String Concat(const String& rightHalf); +}; + +#endif /* _STRING */ -- cgit v1.3.1-23-gd82d