This page was last modified 13:21, 24 June 2008.
Literals
From Forum Nokia Wiki
String Literals are consructed via the _LIT macro. The macro take two params:
- - literal name
- - pointer to the NULL-terminated string
Simple example:
_LIT( KMyLiteral, "My string literal" );
Literals are stored as TLitC objects - they are not actually descriptors themselves, but they can be converted to descriptors:
// operator() TInt len = KMyLiteral().Length()
// operator& const TDesC& ptr = &KMyLiteral;
// implicitly operator const TDesC16&() const void YouFunc( const TDesC& aParam ) { ... } YouFunc( KMyLiteral );
Some old examples in SDK can contain macro _L for literals constructing. Now this macro is deprecated. Always create literals using _LIT !
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why Are Pre-processors Inherently Evil? | grahamhughes | Mobile Java General | 10 | 2005-07-15 14:48 |
| Font & National Code | dboyko | Python | 10 | 2008-06-20 20:41 |
| Thoughts and questions re internationalisation | GerardMason | Mobile Java General | 13 | 2004-08-16 18:49 |
| Telefonica releases its software mobility platform | jmcf_cantera | General Browsing | 1 | 2006-05-30 22:05 |
| N75 installation warning: "Application not compatible with phone. Continue anyway?" | Bogomolny | General Symbian C++ | 5 | 2008-02-25 08:42 |
