LPBYTE buffer = (LPBYTE)calloc(1024, sizeof(char));
std::string res;
I want something like:
res = buffer;
LPBYTE buffer = (LPBYTE)calloc(1024, sizeof(char));
std::string res;
I want something like:
res = buffer;
Copyright © 2021 Jogjafile Inc.
You can use the std::string constructor (number 6 in the link) that uses iterators to copy the buffer into a string:
Note that there is no conversion other than the
unsigned chars in yourbufferbeing converted tochars in thestd::string.