I need to process the data stored in wide strings at a low level. I am able to convert to a vector
of Bytes
with the following method:
typedef unsigned char Byte;
wstring mystring = L"my wide string";
Byte const *pointer = reinterpret_cast<Byte const*>(&mystring[0]);
size_t size = mystring.size() * sizeof(mystring.front());
vector<Byte> byteVector(pointer, pointer + size);
However, I am having trouble going the other way; I am not very familiar with casting. How do I convert a vector
of Bytes
to a wstring
?