Boost logo

Boost Users :

From: Martin Ecker (martin.ecker_at_[hidden])
Date: 2005-08-15 15:46:08


Hi,

Li Lirong wrote:
> How can I save/load my c++ objects to/from a block of memory using
> Boost.Serialization? Can anyone give some sample code?

You can simply stream into a std::stringstream:

std::stringstream stream;
{
   boost::text_oarchive oa(stream);
   oa << my_data;
}

Best Regards,
Martin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net