Website Summary Files Commits Branches @commit @diff @stats
path: root / Week04 / Exercise03 / String.h
diff options
context:
space:
mode:
Commite5c06fbc864205a9736f07f9237ace80617ca471 (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-16 22:41:31 +0200
Committer
 Syndamia <kamen@syndamia.com>
2026-03-16 22:41:31 +0200
Filesf916efca600b104f3489a8501bffa448f11dfe79 /Week04/Exercise03/String.h
oop-2025-solutions-e5c06fbc864205a9736f07f9237ace80617ca471.tar
oop-2025-solutions-e5c06fbc864205a9736f07f9237ace80617ca471.tar.gz
oop-2025-solutions-e5c06fbc864205a9736f07f9237ace80617ca471.zip
Parent5624cd9b63bec13fc464a3d7820d703abd8de113 (diff)
feat(Week04): Add solutions
1 files changed, 25 insertions, 0 deletions
-rw-r--r--Week04/Exercise03/String.h25
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 */