Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Solutions Sem. 08 / ex3 / DynStr.h
diff options
context:
space:
mode:
1 files changed, 17 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/DynStr.h17
diff --git a/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/DynStr.h b/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/DynStr.h
new file mode 100644
index 0000000..8b31da3
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/DynStr.h
@@ -0,0 +1,17 @@
+class DynStr {
+ char* str;
+ int length;
+
+ void free();
+ void copyFrom(const DynStr& other);
+
+public:
+ DynStr();
+ DynStr(const char* str);
+
+ DynStr(const DynStr& copy);
+ DynStr& operator=(const DynStr& other);
+ ~DynStr();
+
+ const char* get_str() const;
+};