diff options
Diffstat (limited to 'week11/Exercise08/Message.h')
| -rw-r--r-- | week11/Exercise08/Message.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/week11/Exercise08/Message.h b/week11/Exercise08/Message.h new file mode 100644 index 0000000..2048263 --- /dev/null +++ b/week11/Exercise08/Message.h @@ -0,0 +1,25 @@ +#pragma once +#include <iostream> + +class Message { + void copyFrom(const Message& other); + void free(); + +protected: + char* textMessage; + +public: + Message(); + virtual ~Message(); + Message(const Message& other); + Message& operator=(const Message& other); + Message(Message&& other); + Message& operator=(Message&& other); + + unsigned Length(); + // Отговорът е не, няма разлика между operator<< на трите класа + // В условието е казано, че текстовото съобщение се показва на екрана, но не е казано че другите данни се + friend std::ostream& operator<<(std::ostream& ostr, const Message& obj); + + virtual unsigned size() = 0; +}; |
