字符串前面L的意思

来源:互联网 发布:程序员上线烧香图片 编辑:程序博客网 时间:2024/04/30 06:47

L是vc中的宏,将ANSI字符串转换成unicode的字符串。

 

A

ANSI character string.

W

Unicode character string.

T

Generic character string (equivalent to W when _UNICODE is defined, equivalent to A otherwise).

OLE

OLE character string (equivalent to W).

 

 

_T是一个宏转换 ,让字符串在unicode和ansi两种编码形式下都编译没问题

Unicode环境下是wchar_t ,ANSI下是char
Unicode下,一个字符代表两个字节, Ansi下是一个字符

PS:用 @ 引起来的优点在于换码序列“不”被处理,这样就可以轻松写出字符串,例如一个完全限定的文件名:   
   
@"c:/Docs/Source/a.txt"       //rather than   "c://Docs//Source//a.txt"

原创粉丝点击