字符串转换为整数的源码atoi()

来源:互联网 发布:淘宝店铺取名大全 编辑:程序博客网 时间:2024/05/23 19:20

#define is_digit(c)((c) >= '0' && (c) <= '9')

 

static int skip_atoi(const char **s)

{

int i=0;

 

while (is_digit(**s))

i = i*10 + *((*s)++) - '0';

return i;

}