My original question is here.
I’d like to write an array of objects into shared memory. Let’s assume we know the starting address of the shared memory. How should I store the array of objects into the shared memory and manipulate the array later(e.g.,access one particular object in the array and even the fields of that object)? Do I have to serialize the objects into the memory and implement relevant access methods myself or does C++ have memory management mechanisms to deal with the details?
This isn’t a particularly thought out answer, but I can’t see where you’re stuck since you didn’t provide any code to give us a hint.
There is a sample program here – Sample Shared Memory Program – with sufficient commenting to make you understand how to achieve what you’re asking though.
So, I’d say read that through carefully and give it a shot 🙂