I was looking for a way to stuff some data into a string across a DLL boundary. Because we use different compilers, all our dll interfaces are simple char*.
Is ther
As long as C++11 gives contiguous memory guaranties, in production practice this 'hacky' method is very popular:
std::string stringToFillIn(100, 0); FunctionInDLL(stringToFillIn.data(), stringToFillIn.size());