you can use the standard stl containers as queue, e.g. a simple vector<Message> will do the job. don't mess with arrays in c++ until you have to. the indicator that no message is in the queue just is vector::empty().
for your messages you can use a simple thing like this:
objects of that struct are just pushed in the vector if received or popped out of the outgoing vector if sended.
serialisation just means that if your sender thread is taking a message from outgoing queue he has to build a "linear stream" from the (structured) object. A really simple form would be for example
than you can pass reinterpret_cast<void*>(ss.str().c_str()) as buffer to your send() call to transmit the message to a socket.
ss << strlen(message1.sender_id.c_str() ) << message1.sender_id
<< strlen(message1.receiver_id.c_str() ) << receiver_id
<< strlen(message1.body.c_str() ) << body;
// the strlen-things in it announce how many chars of an message
// object attribute will follow. youl'll need them if your receiver
// thread is rebuilding (de-serialize) the message object
de-serialization just works the other way around. now the only thing I'll hvae to lern are threads:
oh and in the case you havent found it yet, the good old "Beej's Guide to Network Programming Using Internet Sockets"