3 ms·
> Why ato? Because C doesn’t really have strings, but arrays of bytes, hence “array to int” -> atoi. The lore I was familiar with was that a stood for ascii.
by f33d5173 2y ago
> Why ato? Because C doesn’t really have strings, but arrays of bytes, hence “array to int” -> atoi.
The lore I was familiar with was that a stood for ascii.
- byroot 2y agoYou might be right. I'll try to remember to add a note on that.
- ciupicri 2y agoFrom https://stackoverflow.com/a/2909772 https://stackoverflow.com/a/2909772 > in this listing of man pages from Third Edition Unix (1973) collected by Dennis Ritchie himself, it does contain the line: > > atoi(III): convert ASCII to integer > In fact, even the first edition Unix (ca 1971) man pages list atoi as meaning Ascii to Integer. It's also in the FreeBSD [1], NetBSD [2] and OpenBSD [3] atoi man pages. [1]: https://man.freebsd.org/cgi/man.cgi?query=atoi&sektion=3 https://man.freebsd.org/cgi/man.cgi?query=atoi&sektion=3 [2]: https://man.netbsd.org/atoi.3 https://man.netbsd.org/atoi.3 [3]: https://man.openbsd.org/atoi.3 https://man.openbsd.org/atoi.3
- byroot 2y agoThanks https://github.com/byroot/byroot.github.io/commit/4527ae59483514f5de3dbe674f26e1f63179a8f5 https://github.com/byroot/byroot.github.io/commit/4527ae5948...