aboutsummaryrefslogtreecommitdiff
path: root/week10/Exercise10/ModifiableString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'week10/Exercise10/ModifiableString.cpp')
-rw-r--r--week10/Exercise10/ModifiableString.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/week10/Exercise10/ModifiableString.cpp b/week10/Exercise10/ModifiableString.cpp
new file mode 100644
index 0000000..bd42088
--- /dev/null
+++ b/week10/Exercise10/ModifiableString.cpp
@@ -0,0 +1,14 @@
+#include "ModifiableString.h"
+
+char& ModifiableString::operator[](int index) {
+ return str[index];
+}
+
+char& ModifiableString::operator[](int index) const {
+ return str[index];
+}
+
+ModifiableString& ModifiableString::operator+=(const ModifiableString& right) {
+ String::operator=(*this + right);
+ return *this;
+}