hi,
i tried to convert TBuf to Tint but The Below code are not working
Code:_LIT(mn,"100"); TBuf<100> at; at.Copy(mn); TInt numIndex; TLex iLex(at); iLex.Val(numIndex);
hi,
i tried to convert TBuf to Tint but The Below code are not working
Code:_LIT(mn,"100"); TBuf<100> at; at.Copy(mn); TInt numIndex; TLex iLex(at); iLex.Val(numIndex);
Ok do like this its perfect.
http://wiki.forum.nokia.com/index.ph...Buf_to_TInt%3F
Code looks fine to me. Not working means what happens?? what is final value of numIndex ???
my problem are given below
the value of num ie 100 are successfully writting a FileCode:Tint num=100 LogPrintfL(KLogFile,"num %d ",num);
then
by using the above code the value written in file is not same as actual valueCode:_LIT(mn,"100"); TBuf<100> at; at.Copy(mn); TInt numIndex; TLex iLex(at); iLex.Val(numIndex); LogPrintfL(KLogFile,"num %d ",numIndex);
i m getting below value in file
Code:num -2045913644
ok try one thing, do not write this value in a file just show it in a popup or some alert, then see what vakue it is showing up.For e.g:
TBuf<20>buffer;
buffer.AppendNum(numIndex);
CAknInformationNote*note = new(ELeave)CAknInformationNote;
note->ExecuteLD(buffer);
so now see what value it pop ups
ok thanks
now my problem is
the bove value not write the fileCode:_LIT(mn,"9999999999"); TBuf<256> at; at.Copy(mn); TInt numIndex; TLex iLex(at); iLex.Val(numIndex); TInt ar; ar=numIndex; // TInt64 ac(ar); LogPrintfL(KLogFile,"number %d ", ar);
but
the given value are ie 1234567891 are successfilly written
Code:_LIT(mn,"1234567891"); TBuf<256> at; at.Copy(mn); TInt numIndex; TLex iLex(at); iLex.Val(numIndex); TInt ar; ar=numIndex; // TInt64 ac(ar); LogPrintfL(KLogFile,"number %d ", ar);
Check if 9 999 999 999 happens to be larger than 2 147 483 647 (the largest number which can be represented by a 32-bit signed integer). Then repeat the same check with 1 234 567 891.