I have a simple function in my program, when I was wanting to mess around with unicode and do stuff with it. In this function, I wished to display the code value of the character the user entered. It SEEMED possible, here's my function:
wstring listcode(wchar_t arg) {
wstring str = L"";
str += static_cast<int> (arg); //I tried (int) arg as well
str += L": ";
str += (wchar_t) arg;
return str;
}
Now as you see I just wanted to display the integer value (like an ascii character, such as (int) "a"
), but something like listcode(L"&")
will be displayed as &: &
!
Is it not possible to find the integer value of a wide character like that?