Is the wchar_t
type required for unicode support? If not then what\'s the point of this multibyte type? Why would you use wchar_t when you could accomplish the
wchar_t is not required. It's not even guaranteed to have a specific encoding. The point is to provide a data type that represents the wide characters native to your system, similar to char representing native characters. On Windows, for example, you can use wchar_t to access the wide character Win32 API functions.
char
is generally a single byte. (sizeof(char)
must be equal to 1).
wchar_t
was added to the language specifically to suppose multibyte characters.