Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise03 / String.h
diff options
context:
space:
mode:
Commit571dc57f812a685bda7bd3baf8aaf2ef56feae65 (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-03-28 16:19:58 +0200
Committer
 Syndamia <kamen@syndamia.com>
2026-03-28 16:19:58 +0200
Filesd69f560eccb705339f44be22369bb8fed025e642 /Week05/Exercise03/String.h
oop-2025-solutions-571dc57f812a685bda7bd3baf8aaf2ef56feae65.tar
oop-2025-solutions-571dc57f812a685bda7bd3baf8aaf2ef56feae65.tar.gz
oop-2025-solutions-571dc57f812a685bda7bd3baf8aaf2ef56feae65.zip
Parente5c06fbc864205a9736f07f9237ace80617ca471 (diff)
feat(Week05): Add solutions
1 files changed, 26 insertions, 0 deletions
-rw-r--r--Week05/Exercise03/String.h26
diff --git a/Week05/Exercise03/String.h b/Week05/Exercise03/String.h
new file mode 100644
index 0000000..3b0aa1d
--- /dev/null
+++ b/Week05/Exercise03/String.h
@@ -0,0 +1,26 @@
+#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(String&& other);
+ String& operator=(String&& other);
+
+ String(const char* str);
+
+ bool IsTheSameAs(const String& other) const;
+ const char* GetStr() const;
+};
+
+#endif /* _STRING */