Simply concatenate the two std::string
s into a new std::string
, and then use its c_str()
method, eg:
std::string Path = ...;
std::string username = ...;
std::string fullpath = Path + username;
HANDLE file{ CreateFileA(fullpath.c_str(), ...) };
Or simply:
std::string Path = ...;
std::string username = ...;
HANDLE file{ CreateFileA((Path + username).c_str(), ...) };
CLICK HERE to find out more related problems solutions.