这个名字是`atoi`从何而来? [英] Where did the name `atoi` come from?

查看:97
本文介绍了这个名字是`atoi`从何而来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我一直好奇这一段时间。在C语言中没有他们的地方拿出名称的atoi 的字符串转换为整数?我能想到的唯一的事情就是阵列要整的缩写,但并没有真正意义。

Ok I've been curious about this for a while. In the C language where did they come up with the name atoi for converting a string to an integer? The only thing I can think of is Array To Integer for an acronym but that doesn't really make sense.

推荐答案

这意味着ASCII到整数。同样,你可以有对于ASCII龙, ATOF 为ASCII到浮动等。

It means Ascii to Integer. Likewise, you can have atol for Ascii to Long, atof for Ascii to Float, etc.

一个谷歌搜索的atoiASCII为整数'证实这几个页面。

我无法找到它的所有的官方的来源......但在的this手册页清单第三版的Unix (1973) 通过丹尼斯里奇自己收集的,但它确实包含这一行:

I'm having trouble finding any official source on it... but in this listing of man pages from Third Edition Unix (1973) collected by Dennis Ritchie himself, it does contain the line:

的atoi(III):ASCII码转换为整数

在事实上,即使是第一版的Unix(约1971年)手册页< A HREF =htt​​p://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man3/atoi.3>列表的atoi 因为这意味着ASCII到整数。

In fact, even the first edition Unix (ca 1971) man pages list atoi as meaning Ascii to Integer.

所以,即使没有任何文件比表明的atoi 手册页更多的官方意味着ASCII到整数(我的犯罪嫌疑人的存在和我只是一直没能找到它),它已经ASCII到整数的按约定的自1971年以来最少。

So even if there isn't any documentation more official than man pages indicating that atoi means Ascii to Integer (I suspect there is and I just haven't been able to locate it), it's been Ascii to Integer by convention at least since 1971.

这篇关于这个名字是`atoi`从何而来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆