Re: atoi( ) deprecation question...
Re: atoi( ) deprecation question...
- Subject: Re: atoi( ) deprecation question...
- From: Philip George <email@hidden>
- Date: Fri, 17 Jan 2003 03:29:00 -0600
This snippet cannot use Obj-C api's. Strictly straight C. Also, the
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.
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.
strtoll() is preferable, by the way. Anyone know if it will run (not
compile, JUST RUN) on OS X 10.0 and the earliest reference releases of
BeOS, Windows(NT-type), and Linux?
- Philip
On Friday, January 17, 2003, at 02:16 AM, John C. Randolph wrote:
On Thursday, January 16, 2003, at 11:44 PM, Philip George wrote:
I know that when the man page for atoi( ) says that it is
"deprecated," it at least means that the api will be pulled at some
point and code that uses it will therefore not compile anymore, but
does it also mean that my currently compiled app (with atoi() call in
it) won't run on some future build of OS X?
When something's deprecated, that means you shouldn't use it, because
it *might* go away at some point in the future, or that there is a
better way to do wha it does.
atoi() is part of the standard C library, so I wouldn't worry that
it's going to go away. I would however, avoid using it since it takes
an ASCII string as input, and we're moving away from ASCII in favor of
unicode.
These days, when we want a floating-point value from a string, we just
send a -floatValue message to an instance of NSString.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.