String literalssuggest change
String literals are used to specify arrays of characters. They are sequences of characters enclosed within double quotes (e.g.
"abcd" and have the type
L prefix makes the literal a wide character array, of type
wchar_t*. For example,
Since C11, there are other encoding prefixes, similar to
prefix | base type | encoding |
—— | —— |—— |
char | platform dependent |
wchar_t | platform dependent |
char | UTF-8 |
char16_t | usually UTF-16 |
char32_t | usually UTF-32 |
For the latter two, it can be queried with feature test macros if the encoding is effectively the corresponding UTF encoding.
Found a mistake? Have a question or improvement idea? Let me know.
Table Of Contents