What is "L" in C++

May 22, 2011 at 11:11am
Like we place L"string" in some cases
What type of token is this L?
May 22, 2011 at 11:30am
To specify a string literal of type wide-character , precede the opening double quotation mark with the character L.
May 22, 2011 at 11:35am
I've always wondered, is that defined in a Windows header, or does the compiler recognise it intrinsically?
May 22, 2011 at 11:37am
Wide strings are part of the C++ standard.
May 22, 2011 at 11:45am
Okay then, so is it in a standard header file or recognised by the compiler? I had always assumed the former, but intellisense doesn't list it in my experience.
May 22, 2011 at 12:08pm
Nah, it's not defined in any header. The L just marks the literal as a wide literal, similar to how the f in 1.0f denotes a float literal.
May 22, 2011 at 12:11pm
Ah, that makes sense. Thanks :)
Topic archived. No new replies allowed.