I'm reading numeric strings from a comma delimited file. So now I'm trying to figure out how to convert the strings (descriptors) to type double or integer. I tried using atoi/atof with no luck..how is it done with symbian?
I'm reading numeric strings from a comma delimited file. So now I'm trying to figure out how to convert the strings (descriptors) to type double or integer. I tried using atoi/atof with no luck..how is it done with symbian?
I suggest you review the TLex class -- there are 18 Val's there, also for TReal's....
BUT note!! TLex is locale dependent. So for example in Finnish locale, decimal separator is not period but comma. If you assume a period separator, you may notice that parsing a "23.121" returns value 23 (cutting out the decimal part), not 23.121....
Forum posts: 982
Thanks
There is no a atoi/atof in Symbian. But if you check in the forum you'll find solutions to your problem. For example check
http://forum.newlc.com/viewtopic.php?t=915
http://forum.newlc.com/viewtopic.php?t=4306
pirosl
Forum posts: 2
http://forum.newlc.com/viewtopic.php?t=3764&highlight=
thanks!
Forum posts: 1
Severity and Description
Myappui.cpp:(.text+0x3724): undefined reference to `atoi'
i found it inside
#include <libc/stdlib.h>and manage to get it to run in debug mode in the emulator after adding
\epoc32\include\libc
under SYSTEMINCLUDE in my .mmp file
however i still get the above error when building for release version of the sisx.
how to solve this???
any1?
Forum posts: 85
For integers, there is TLex::Val(). For floating point numbers, I don't know of any available API, you might need to write your own.
Forum posts: 683
I suggest you review the TLex class -- there are 18 Val's there, also for TReal's....
BUT note!! TLex is locale dependent. So for example in Finnish locale, decimal separator is not period but comma. If you assume a period separator, you may notice that parsing a "23.121" returns value 23 (cutting out the decimal part), not 23.121....