宽字符字面量前缀 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.
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.
...全文
相关推荐
浅谈C中的wprintf和宽字符显示
浅谈C中的wprintf和宽字符显示 非常值得收藏的一篇文档
在Unicode宽字符下CString转int的方法
在Unicode宽字符下CString转int的方法 在Unicode下CString转int的方法 在Unicode下CStringToint 在Unicode下CString转int 在Unicode宽字符下CString转int的方法 在Unicode下CString转int的方法 在Unicode下CStringToint 在Unicode下CString转int
关于char,_wchar_t,_TCHAR,__T(),L,宏__T、TEXT,_TEXT、L.
关于char,_wchar_t,_TCHAR,__T(),L,宏__T、TEXT,_TEXT、L.
浅析c++ 宏 #val 在unicode下的使用
以下是对c++中宏#val在unicode下的使用方法进行了详细的分析介绍,需要的朋友可以参考下
摄氏度,摄氏度符号 ℃怎么打,C,C++源码.rar
摄氏度,摄氏度符号 ℃怎么打,C,C++源码.rar


