C – ATOI () – String to INT

I read that atoi() has been deprecated, it is equivalent to:

(int)strtol(token_start, (char **)NULL, 10);

Does this mean I should use the above instead of atoi(chr) or does it just say that they are equivalent?

It is indeed in Apple’s Mac OS X Manual Page for atoi(3) (and the BSD manual page ) Said atoi has been deprecated.

The atoi() function has been deprecated by strtol() and should not be
used in new code.

I will use strtol() equivalent for this reason, but I suspect you have to worry about atoi() being removed.

From http: //www.codecogs.com/library/computing/c/stdlib.h/atoi.php start
Implementation instructions

* The atoi function is not thread-safe and also not async-cancel safe.
* The atoi function has been deprecated by strtol and should not be used in new code.

I read atoi( ) Has been deprecated, it is equivalent to:

(int)strtol(token_start, (char **)NULL, 10);

Does this mean that I should use the above instead of atoi(chr) or does it just say that they are equivalent?

It is indeed stated in Apple’s Mac OS X Manual Page for atoi(3) (and the BSD manual page) that atoi is deprecated.

The atoi() function has been deprecated by strtol() and should not be
used in new code.

I will use strtol() equivalent for this reason, but I suspect you have to worry about atoi() being deleted.

From http://www.codecogs.com/library/computing/ c/stdlib.h/atoi.php start
Implementation instructions

* The atoi function is not thread-safe and also not async-cancel safe.
* The atoi function has been deprecated by strtol and should not be used in new code.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 372 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.