yes*_*nes 16 c naming-conventions atoi
我理解所说的函数是做什么的,但我不知道他们的名字是如何创建的,除了最后一个字母来自返回类型.
101*_*010 31
atoi -> ASCII to integer.
atol -> ASCII to long.
atof -> ASCII to floating.
stoi -> string to integer.
stol -> string to long.
stoll -> string to long long.
stof -> string to float.
stod -> string to double.
stold -> string to long double.
Run Code Online (Sandbox Code Playgroud)
atoi,atol,atof来自C其教父最有可能被认为是肯·汤普森 UNIX操作系统的共同创造者和创造者■编程语言是C语言的前身.这些名称在1971年11月3日的第一个UNIX程序员手册中提到,正如你在主人的标签中看到的那样,ken提到了Ken Thomson的昵称:
stoi,stol,stoll,stof,stod并stold得到了在C++,因为C++ 11.因此,命名必须是C++委员会的一致决定.最初的提案N1803可以追溯到2005年.我在提案中找不到为什么在这些名称之后命名这些函数.我猜他们可能想要保持上面提到的C"等价物"的一致性.