【问题标题】:What is the L for in wcout<<L? [duplicate]wcout<<L 中的 L 是什么意思? [复制]
【发布时间】:2015-03-06 11:16:40
【问题描述】:

有什么区别

std::wcout << "some text" ;

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

我找不到有关 L 用途的信息。

【问题讨论】:

    标签: c++ unicode cout wstring


    【解决方案1】:

    L "blah blah" 是一个宽字符串文字 (const wchar_t[]),因此您使用 wcout 而不是 cout

    【讨论】:

      【解决方案2】:

      L 不属于wcout,而是属于string literal

      参见上面链接的参考

      2) 宽字符串文字。 L"..." 字符串字面量的类型是const wchar_t[]

      【讨论】:

        猜你喜欢
        • 2010-11-01
        • 2013-10-06
        • 2017-11-23
        • 1970-01-01
        • 2016-02-14
        • 1970-01-01
        • 2023-04-08
        • 1970-01-01
        • 2014-09-28
        相关资源
        最近更新 更多