hi there,
happy new year to everyone!

i'm looking into ways to save a string of variable length in a shared memory segment.
the string will be accessed by 2 applications and should be ASCII extended format.
the one application is a GUI written with QT,in which i write the string length in an int and then a 'char CStringOnShMem' variable follows. in order to write the c string in the memory i memcpy the char* c string to its length , on to a reference &CStringOnShMem in the shared memory. im not so sure this is a nice way but it worked.

on the other applications side (and remembering that the 2 applications have identical shared memory structures) if i try to memcpy the c string in the same way i only get the first 4 bytes of the string copied. if i try to do a realloc() of the &CStringOnShMem i get a segfault at runtime, which is normal considering the compiler knows that &ToChar is 4bytes long and no realloc should change that.

so i went back to the GUI and tried to convert the CStringOnShMem to a char* and do a realloc just b4 the memcpy. but i get a segfault at runtime on the GUI side now too. any suggestions?
thank youi in advance for your help
nass