LAS_VEGAS
16-02-2005, 09:53 AM
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.
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.