MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / Message

Method Message

Examples/NoModules/Chapter 13/Ex13_12B/Message.h:9–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7{
8public:
9 explicit Message(const char* text = "")
10 : m_text(new char[std::strlen(text) + 1]) // Caution: include the null character!
11 {
12 std::strcpy(m_text, text); // Mind the order: strcpy(destination, source)!
13 }
14 ~Message() { delete[] m_text; }
15
16 Message(const Message& message); // Copy constructor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected