简体   繁体   中英

array of std::string in shared memory.

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM