Somebody know What is the name of this algorithm?
This is an algorithm for converting an string to an integer:
int n = 0;
for (i = 0; i < digits.lengt开发者_高级运维h; i++)
n = n * 10 + (digits[i] - '0');
Somebody know what is the name of this algorithm? I need it for a reference in an article. I have used it but now I need some reference.
If you had to give a name to it, most likely it would be atoi
(like the C function)
精彩评论