Keith Thompson wrote:
"Old Wolf" <ol*****@inspire.net.nzwrites:
sarathy wrote:
Can anyone please explain what are wide characters (wchar_t).
Characters with more than 256 possible values
Well, char can have more than 256 possible values if CHAR_BIT 8.
For that matter, I don't think there's any guarantee that wchar_t
actually can represent more than 256 values, though it's fairly
pointless if it can't.
There's not any guarantee that wchar_t can represent more than 255
values, if it is signed. I wouldn't call it pointless though: code
shouldn't have to check whether wchar_t is defined, and use char if it
isn't. You can simply assume wchar_t exists, and if the implementation
does not support multibyte characters, the code will still work as well
as possible. Pretty much every important string function has both a
narrow and a wide string version, and every one would have to be
wrapped in a #if USE_WCHAR_T block otherwise.