在C语言中,他们提出了将字符串转换为整数的名称atoi
吗?我唯一能想到的是Array To Integer的首字母缩略词,但这并没有多大意义。
这意味着Ascii到整数。同样,你可以有Ascii到long的atol
,用于Ascii到Float的atof
等。
A Google search for 'atoi "ascii to integer"'在几页上证实了这一点。
我很难找到任何官方消息来源......但是在丹尼斯·里奇本人收集的this listing of man pages的Third Edition Unix (1973)中,它确实包含以下内容:
atoi(III): convert ASCII to integer
事实上,即使是first edition Unix (ca 1971)手册list atoi
as meaning Ascii to Integer。
因此,即使没有任何文档比官方页面更正式表明atoi
意味着Ascii到Integer(我怀疑存在而且我只是无法找到它),所以至少自1971年以来,它已经按照惯例进行了Ascii to Integer 。
我悲伤地认为函数atoi意味着ascii到整数。