Re: atoi( ) deprecation question...
Re: atoi( ) deprecation question...
- Subject: Re: atoi( ) deprecation question...
- From: Chris Ridd <email@hidden>
- Date: Fri, 17 Jan 2003 10:52:42 +0000
On 17/1/03 9:29 am, Philip George <email@hidden> wrote:
>
This snippet cannot use Obj-C api's. Strictly straight C. Also, the
Well you did email this question to the cocoa list so IMO you got an
entirely appropriate answer :-)
>
particular string in question is guaranteed to always be in ascii
>
format.
>
>
I'll switch to strtoll() if I can be sure that it will work on OS X
>
10.0 and the earliest reference releases of BeOS, Windows(NT-type), and
>
Linux.
The strtol() function is part of the standard original ANSI C library, like
atoi().
I'm not sure if strtoll() is defined by any standard - a quick google
suggested that it wasn't. If it isn't then you probably shouldn't rely on
it.
>
If that can't be guaranteed and atoi() is going to all of a sudden not
>
work in future releases of any of those OS's, then I have a problem.
I don't believe that John said it was going to go away, rather the reverse.
The man page simply recommends not to use it, and instead to use strtol()
because it has various improvements over atoi(). For example you can detect
errors if you use strtol(), which has got to be useful ;-)
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.