宽字符字面量前缀 L 是什么意思?
咬文嚼字
1,C/C++标准里没有任何解释
2,Rationale 里只解释了为什么用前缀而不是后缀
那么,L 难道就是 Literal 的首字母?或是 Large,或是 Long ?
何不用 Wide ?据说是重用已有的 long 字面量后缀字母?
有没有确切的说法
大家认为是什么
下面是引文
C99
$6.4.5 String literals
$6.4.5/2
A character string literal is a sequence of zero or more multibyte characters enclosed in double-quotes, as in "xyz".A wide string literal is the same, except prefixed by the letter L.
C++2003
$2.13.2 Character literals
$2.13.2/1
A character literal is one or more characters enclosed in single quotes, as in ’x’, optionally preceded by the letter L, as in L’x’.
$2.13.2/2
A character literal that begins with the letter L, such as L’x’, is a wide-character literal. A wide-character literal has type wchar_t.
Rationale for International Standard Programming Languages C
$6.4.5 String literals
An L prefix distinguishes wide string literals. A prefix rather than a suffix notation was adopted so that a translator can know at the start of the processing of a string literal whether it is dealing with ordinary or wide characters.