tags:

views:

111

answers:

3

I'm exploring wxWidgets and at the same time learning C/C++. Often wxWidgets functions expect a wxString rather than a string, therefore wxWidgets 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"?

+5  A: 
  • "banana" is the word written using 1-byte ASCII characters.

  • L"banana" is the word written using multi-byte (general 2=byte UNICODE) characters.

James Curran
On most 32-bit linux systems (I'm not sure about 64-bit) multi-byte characters are usually 4 bytes.
Joe D
+2  A: 

L is a flag on strings to let it know it's a wide (unicode) string.

Jason Scheirer
+2  A: 

The L tells your compiler that it's a unicode string instead of a "normal" one.

Alexander Kjäll