Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need some constructors created in C++ linux that follow the following header f

ID: 3908714 • Letter: I

Question

I need some constructors created in C++ linux that follow the following header file and conditions.

class Message public: // constructors /* Sets Message instance's body to empty string Message (); /* Sets Message instance's body to char array parameter */ Message(const char body[]); /* Sets Message instance's body to string parameter.* Message (const std::string& body);

Explanation / Answer

#include #include using namespace std; class Message { public: Message(); Message(const char body[]); Message(const std::string& body); private: string body; }; Message::Message() { this->body = ""; } Message::Message(const char body[]) { int i=0; this->body = ""; while(body[i]) { this->body += body[i]; i++; } } Message::Message(const std::string& body) { for(int i = 0; i body += body[i]; } } int main() { return 0; }