Reputation: 1145
Sorry for this amateurish question, I want to do some search and comparisions within an unicode string.
I am a little bit confused about unicode-16
/wchar_t
, in windows OS, does this stored the same way as an array of uint16
?
I mean if I can use it this way without any trouble?
wchar_t a[100];
somefunction((uint16 *)a);
//treat a as an array of uint16 data and do something with it.
Upvotes: 0
Views: 214
Reputation: 281355
Yes, it's an array of wchar_t
, which is a uint16_t
. It's also (usually) NUL-terminated, meaning there's a zero-valued wchar_t
at the end of the string.
Upvotes: 3