I have two char* strings and a char* literal that I need to combine into a single std::string. Below is what I am doing. It works, but I don’t like the way it looks (3 lines to accomplish it). I am wondering if there is a better way to do it…
std::string strSource = _szImportDirectory;
strSource += "\\";
strSource += _szImportSourceFile;
Thanks for you help!
Is one obvious way.
Another way is to use
std::stringstream:That’s the most flexible and maintainable way to do it but it still requires three lines.