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?
What does "itoa" stand for in strconv.Itoa?
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. –
Footman Was editing my comment to add that, when I noticed it was tagged Go. Thanks! –
Funderburk
this is wrong.
A
is coming from ASCII
, not from array: #2910268 –
Mihalco The guys who developed Go at Google, also wrote most of Unix and Plan9. So there are many other Unix references littered throughout the documentation. –
Mcbee
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. –
Setula
© 2022 - 2024 — McMap. All rights reserved.
i
ntegerto
a
scii: #2910268 – Mihalco