convert integer to a string ???
| Wed, 2004-10-13 06:20 | |
|
How can I convert an integer with the data type TInt32 to a string?
And then I can use LIT(KSTRING,"the integer's string"); then I can use iEikonEnv->InfoMsg(KSTRING) to show the integer out. Who can give me some help ? Or the solution to solve my problem without using my method ? |
|






Forum posts: 32
Following might work for you:
// length at runtime
TBuf<64> buf;
buf.Zero();
TInt32 integerToPrint = 54;
_LIT(KIntegerFormat, "Integer: %d");
buf.AppendFormat(KIntegerFormat, integerToPrint);
// buf now contains "Integer: 54"
// do whatever you like with it
Jari
Forum posts: 21
If this is for debugging and you just want to get the number out this works too:
TInt number;
number=SomeFunction();
TBuf<20> num;
num.AppendNum(number);