This code is not compilable:
LPSTR a1 = "a1";
LPSTR lpResult = a1 + "a2";
How can I get a long pointer lpResult to the "a1a2" string?
This code is not compilable:
LPSTR a1 = "a1";
LPSTR lpResult = a1 + "a2";
How can I get a long pointer lpResult to the "a1a2" string?
One option is to use the std::string concatenation. You can also use Microsoft's StringCchCat function.
Here's an example:
#include <Strsafe.h>
//... later in your code:
LPSTR a1 = "a1";
LPSTR a2 = "a2";
TCHAR dest[ 5 ];
StringCchCopy(dest, 5, a1); // copy "a1" into the buffer
StringCchCat(dest, 5, a2); // concatenate "a2" into the buffer