且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么不应该使用的atoi()?

更新时间:2023-11-13 16:13:16

>:

的的atoi()函数被与strtol归入(),但被保持,因为它是在现有code广泛使用。 如果数量不知道是在范围内,()应该是因为与atoi()执行任何错误检查不要求使用与strtol。

The atoi() function is subsumed by strtol() but is retained because it is used extensively in existing code. If the number is not known to be in range, strtol() should be used because atoi() is not required to perform any error checking.

或者

的atoi 是过时