In Visual Basic = Chr(65), in Symbian = ?
| Tue, 2003-12-02 09:16 | |
|
I have this question. I developed a program in Visual Basic that create this kind of string: Dim byte1 As String byte1 = Chr(65) Chr gaves me (in this case) the character "A". You know, 65 is the ASCII code for A. Now, how can I do the same thing in Symbian C++ ?Wich library Let me know...Screener_it |
|






?
Forum posts: 70
U can do like this
TBuf16<256> tgt;
_LIT16(KFormat,"[%c]");
tgt.Format(KFormat,65); // U Get 'A'
Hope it may help u
Forum posts: 106
If you want to use the variable, the following will suffice :-
char aMyChar;
aMyChar = 65;
Just like any normal C++ program.
If you want to print it, meenuj's solution is correct, but a 256 character buffer will be overkill. Try the following modification :-
TBuf<2> tgt;
_LIT(KFormat,"[%c]");
tgt.Format(KFormat,65); // U Get 'A'
Regards,
Varun
Regards,
Varun
Forum posts: 27
The TBuf's length should be at least 3, two for the [] and one for the character. Otherwise a USER11 panic will be raised.
Regards, inv
"Help a man when he's in trouble and he will remember you...when he is in trouble again."