开发者

Learning C: strange code, what does it do?

开发者 https://www.devze.com 2023-01-11 04:14 出处:网络
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

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 wxStrings. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消