C&C++   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了c – atoi() – 字符串到int大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我读到atoi()已被弃用,它相当于:

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

这是否意味着我应该使用上面而不是atoi(chr)或者它只是说它们是等价的?

解决方法

它确实在Apple的 Mac OS X Manual Page for atoi(3)(以及BSD手册页)中说过atoi已被弃用.

我会因为这个原因使用strtol()等效,但我怀疑你不得不担心atoi()被删除.

http://www.codecogs.com/library/computing/c/stdlib.h/atoi.php开始
实施说明

* 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.

大佬总结

以上是大佬教程为你收集整理的c – atoi() – 字符串到int全部内容,希望文章能够帮你解决c – atoi() – 字符串到int所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: