I'm kind of new to using Unicode string and pointers and I've no idea how the conversion to unicode to ascii and versa-versa works. Following is what I'm trying to do,
const wchar_t *p = L"This is a string";
If I wanted to convert it to char*
, how would the conversion work with converting wchar_t*
to char*
and vice-versa?
or by value using wstring
to string
class object and vice-versa
std::wstring wstr = L"This is a string";
If i'm correct, can you just copy the string to a new buffer without conversion?