Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Hello World!

0 replies · 1,234 views · Started 16 February 2005

Hello World!
I'm new to symbian and new to this forum, though I'm not new to C++ 😊

I want to pass a string to a function something like this:

myFunction("hello world"😉;

Of course in Symbian, things are not easy like that, so it should be changed to this

myFunction(_L("hello world"😉);

However, according to documentation _L is deprecated so I should change the above code to:

_LIT(KMYSTRING,"hello world"😉;
myFunction(KMYSTRING);

The thing I don't like with this solution is that a local variable(KMYSTRING) has to be created just for passing a variable to a function. Is there a more elegant way of doing this without creation of local variable?

Thanks in advance for your suggestions.