Re: atoi( ) deprecation question...
Re: atoi( ) deprecation question...
- Subject: Re: atoi( ) deprecation question...
- From: "Clark S. Cox III" <email@hidden>
- Date: Fri, 17 Jan 2003 09:32:14 -0500
On Friday, Jan 17, 2003, at 08:51 US/Eastern, Andy Lee wrote:
At 6:49 AM -0600 1/17/03, Philip George wrote:
Actually, OS X is really the only target OS where I definitely need
the code to run on the OS's earliest release (10.0). As far as
Linux, BeOS, and Windows NT go, it's not so crucial.
Why not write your own ASCII-to-integer function? Seems to me you
could do this in a portable way, at very little cost in programming
time, performance, or risk.
There's no need, just use strtol. The reason that atoi is a bad idea
to use, is that there is no way to detect error conditions. (i.e.
atoi("This is not a number") and atoi("0") both return the same thing).
_______________________________________________
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.