Reputation: 167
I wonder how visual c++ std::string is populated in memory.
For example if I declare std::string container[10]
in a shared memory region, then can I insert any length of string into this array at run-time ?
Since it is known that shared memory region can not expand at run-time, then how can we insert varying size of strings into this array ?
Upvotes: 1
Views: 1269
Reputation: 54592
That sounds like a really bad idea. std::string involves dynamic memory allocation, pointers, etc. If you have two processes that run in separate address spaces accessing it, I don't see how that could work.
Upvotes: 1