|
|
|
|
|
|
TestObj
structure as a simple block of consecutive bytes, because it contains the complex class std::string which does its own memory management. Perhaps the simplest solution (though may not suit your requirements) is to change the struct to use only primitive types, in this case a c-string (array of characters) rather than std::string.