I'm exploring wxWidgets and at the same time learning C/C++. Often wxWidgets functions expect a wxString
rather than a string
, therefore wxWidget开发者_运维知识库s provides a macro wxT(
yourString)
for creating wxString
s. My question concerns the expansion of this macro. If you type wxT("banana")
the expanded macro reads L"banana"
. What meaning does this have in C? Is L a function here that is called with argument "banana"?
"banana"
is the word written using 1-byte ASCII characters.L"banana"
is the word written using multi-byte (general 2=byte UNICODE) characters.
L is a flag on strings to let it know it's a wide (unicode) string.
The L tells your compiler that it's a unicode string instead of a "normal" one.
精彩评论