atoi/atof equivalent in Symbian?

Login to reply to this topic.
Tue, 2005-03-08 07:46
Joined: 2005-03-08
Forum posts: 2
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?

Thanks

Tue, 2005-03-08 08:33
Joined: 2004-05-24
Forum posts: 982
Re: atoi/atof equivalent in Symbian?
Quote from: VicRSTi
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?

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

Tue, 2005-03-08 08:36
Joined: 2005-03-08
Forum posts: 2
atoi/atof equivalent in Symbian?
I've been searching and found this:  
http://forum.newlc.com/viewtopic.php?t=3764&highlight=

thanks!
Tue, 2008-09-02 06:44
Joined: 2008-09-02
Forum posts: 1
Re: atoi/atof equivalent in Symbian?

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?

Tue, 2008-09-02 12:31
Joined: 2008-06-23
Forum posts: 85
Re: atoi/atof equivalent in Symbian?

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.

Tue, 2008-09-02 12:47
Joined: 2003-12-05
Forum posts: 683
Re: atoi/atof equivalent in 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....

  • Login to reply to this topic.