1

What is the difference between

std::wcout << "some text" ;

and

std::wcout <<L "some text";

?

I couldn't find information on what the L is used for.

Piotr Skotnicki
  • 46,953
  • 7
  • 118
  • 160
RonenKi
  • 370
  • 4
  • 11

2 Answers2

6

The L doesn't belong to the wcout but to the string literal.

See from the reference linked above

2) Wide string literal. The type of a L"..." string literal is const wchar_t[]

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
2

L "blah blah" is a wide string literal (const wchar_t[]), hence why you're using wcout rather than cout.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953