First, here is my code:Now what I want to do with this is have the message class create a message, and then have the mailbox class store that message. But I'm having problems trying to visualize how to move the information in the new message object to the mailbox. This may be a stupid question, but classes make my head spin, and I can't for the life of me make it do what I want. Thanks in advance!Code:#include <iostream> #include <string> using namespace std; class message { public: message(); ~message(); string to; string from; string all; class mailbox { public: void mailbox::add_message(message) { // do something to store the string in a file } private: }; private: }; message::message() { to = "to"; from = "from"; all = to + from; // create a string with the message in it } message::~message() { } int main() { message bob; message::mailbox homer; homer.add_message(bob); }
jim