I understand what it does: specifies a string literal as a const wchar_t *
(wide character string) instead of const char *
(plain old characters), but how is it actually defined?
Is it a macro of some sort? Is it an operator for GCC compilers? What is it?
The literal prefixes are a part of the core language, much like the suffixes:
Note that
wchar_t
has nothing to do with Unicode. Here is an extended rant of mine on the topic.It's called an encoding prefix:
2.14.5 String literals [lex.string]
and marks a wide string literal:
The meaning of L here is wide character:
wchar_t
. String with L is coded in 16bit rather than 8bit, take an example: