What to watch out for when converting a std::string to a char* for C function?
问题 I have read many posts asking the question on how to convert a C++ std::string or const std::string& to a char* to pass it to a C function and it seems there is quite a few caveat's in regards to doing this. One has to beware about the string being contiguous and a lot of other things. The point is that I've never really understood all the points one needs to be aware of and why ? I wondered if someone could sum up the caveats and downfalls about doing a conversion from a std::string to a