diff options
feat(Week04): Add solutions
1 files changed, 25 insertions, 0 deletions
| -rw-r--r-- | Week04/Exercise03/String.h | 25 |
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 */ |
