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?
Asked
Active
Viewed 4,339 times
1 Answers
41
integer to ASCII. It comes from the C language/UNIX. See this thread for more: 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!
-
Also, it's called `itoa` because the precedent set by C to use that name for this kind of conversion. – Tushar Apr 04 '13 at 04:47
-
Was editing my comment to add that, when I noticed it was tagged Go. Thanks! – X-Istence Apr 04 '13 at 04:49
-
2this is wrong. `A` is coming from `ASCII`, not from array: http://stackoverflow.com/questions/2909768/where-did-the-name-atoi-come-from – mvp Apr 04 '13 at 04:53
-
1The guys who developed Go at Google, also wrote most of Unix and Plan9. So there are many other Unix references littered throughout the documentation. – CyberFonic Apr 04 '13 at 05:31
-
It doesn't really make sense. It's historical baggage that the Go apis have mostly abandoned - but not in this case. Despite UTF8 adoption growing, ASCII is not yet dead, alas. – Rick-777 Apr 04 '13 at 22:39