字符串前面L的意思

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"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章