This is why it works unsigned short var= L'ÿ', but unsigned short var[]= L"ÿ";does not work?
unsigned short var= L'ÿ'
unsigned short var[]= L"ÿ";
L'ÿ'has a type wchar_tthat can be implicitly converted to unsigned short. L"ÿ"has a type wchar_t[2]that cannot be implicitly converted to unsigned short[2].
L'ÿ'
wchar_t
unsigned short
L"ÿ"
wchar_t[2]
unsigned short[2]
Lis a prefix for wide literals and wide format string literals. This is part of the language, not the headline. It is also not specific to GCC. They will be used like this:
L
wchar_t some_wchar = L'ÿ'; wchar_t *some_wstring = L"ÿ"; // or wchar_t some_wstring[] = L"ÿ";
unsigned short something = L'ÿ';, wchar_t . , wchar_t * short.
unsigned short something = L'ÿ';
wchar_t - typedef . , , . , , L'ß ' , , , , .
typedef
, . ( ) , , wchar_t. , void*.
void*
, , , , . Windows wchar_t 16- Unicode, 16- . , ( C BMP Unicode , C), .
Unix- 32- wchar_t, , , , short * wchar_t * .
short *
wchar_t *
C
Source: https://habr.com/ru/post/1652746/More articles:Попытка понять цикл Python с использованием подчеркивания и ввода - pythonHttps connection closed by peer in android 5.0 lollipop - javad3-generated SVG not responding - javascriptIs a long string literal of type long int *? - cHow can I find a complete list of platform-specific hooks in the JDK, such as timezone, coding, line endings, etc.? - javaHow to block private class methods under control of Mockito - javaUnable to convert Python list to timeSeries - pythonAdmob for interstitial iOS video starts in background at boot - iosFParsec Parses Unordered Articles - f #What is faster ion2 or nativescript? - nativescriptAll Articles