“itoa”在strconv.Itoa中代表什么意思?

huangapple go评论90阅读模式
英文:

What does "itoa" stand for in strconv.Itoa?

问题

这可能听起来像一个愚蠢的问题...但是我找不到任何地方解释strconv.Itoa中的"a"代表什么。如果它是将整数转换为字符串,为什么函数不叫做Itos?

英文:

This might sound like a silly question... But I can't find anywhere what the "a" in strconv.Itoa actually stands for. If its taking an integer and turning it into a string, why isn't the function called Itos?

答案1

得分: 41

整数转ASCII。它来自C语言/UNIX。更多信息请参见此线程:https://stackoverflow.com/questions/2909768/where-did-the-name-atoi-come-from

在C语言中,没有字符串的概念,你有以空字符结尾的字符数组。

感谢 @mvp!

英文:

integer to ASCII. It comes from the C language/UNIX. See this thread for more: https://stackoverflow.com/questions/2909768/where-did-the-name-atoi-come-from

In the C language, there is no concept such as strings, you have arrays of characters that are null terminated.

Thanks to @mvp!

huangapple
  • 本文由 发表于 2013年4月4日 12:45:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/15802695.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定