9 Jun
2014
9 Jun
'14
10:05 a.m.
El 09/06/2014 1:59, Hany Assasa escribió:
*Possible Answer:*
I believe the answer to my question is, converting |std::string| into |my_string| type. so can anyone tell me how to do that?
my_string ms(std_string.c_str(), shm_allocator); or my_string ms(std_string.begin(), std_string.end(), shm_allocator); There area many possible ways using my_string constructor. You must always pass an allocator. However I don't think that's your problem. Do you have internal zero bytes in "char *data"? Just check if strlen(data) is equal to data_to_share.size(). If you have internal zeroes, use (data_to_share.begin(), data_to_share.end(), managed_shm.get_segment_manager()); to build the shared memory string. Best, Ion