Re: atoi( ) deprecation question...
Re: atoi( ) deprecation question...
- Subject: Re: atoi( ) deprecation question...
- From: Philip George <email@hidden>
- Date: Fri, 17 Jan 2003 06:08:35 -0600
Cocoa is built ontop of straight C, so it's fair game to post such a
question on a Cocoa dev list.
The question stands: Does anyone know if strtoll() will run (not
compile, JUST RUN) on OS X 10.0?
My testbed iMac is loaned out at the moment or I would test it myself.
The man page for strtoll() says that it was implemented in 1993, so I
would have to guess that it's probably usable in the earliest reference
rev's of the target OS's I mentioned before: OS X, Linux, BeOS,
Windows NT).
...but of course that's just a guess. And since guessing is not 1/2
the battle and knowing is... tell me if you know the answer to this
question... anyone.
Thanks.
- Philip
On Friday, January 17, 2003, at 04:52 AM, Chris Ridd wrote:
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.