atol的实现代码
来源:互联网 发布:淘宝网上怎么买处方药 编辑:程序博客网 时间:2024/05/22 02:07
long __cdecl atol(
const char *nptr
)
{
int c; /* current char */
long total; /* current total */
int sign; /* if '-', then negative, otherwise positive */
/* skip whitespace */
while ( isspace((int)(unsigned char)*nptr) )
++nptr;
c = (int)(unsigned char)*nptr++; sign = c; /* save sign indication */
if (c == '-' || c == '+')
c = (int)(unsigned char)*nptr++; /* skip sign */
total = 0;
while (isdigit(c)) {
total = 10 * total + (c - '0'); /* accumulate digit */
c = (int)(unsigned char)*nptr++; /* get next char */
}
if (sign == '-')
return -total;
else
return total; /* return result, negated if necessary */
}
const char *nptr
)
{
int c; /* current char */
long total; /* current total */
int sign; /* if '-', then negative, otherwise positive */
/* skip whitespace */
while ( isspace((int)(unsigned char)*nptr) )
++nptr;
c = (int)(unsigned char)*nptr++; sign = c; /* save sign indication */
if (c == '-' || c == '+')
c = (int)(unsigned char)*nptr++; /* skip sign */
total = 0;
while (isdigit(c)) {
total = 10 * total + (c - '0'); /* accumulate digit */
c = (int)(unsigned char)*nptr++; /* get next char */
}
if (sign == '-')
return -total;
else
return total; /* return result, negated if necessary */
}
- atol的实现代码
- 【转载整理】atol的实现代码
- atol实现
- atol(atoi)函数的实现要点
- atol(atoi)函数的实现要点
- atoi atol实现
- atol函数简单实现
- atol,字符串转化成long型的实现
- atol的写法
- atol
- atol
- 自己实现 atol, inet_addr 源代码
- atol和stoi的用途
- 可移植版本的atol
- atol和strtol的区别
- itoa()和atoi()/atol()的源码
- atof,atol,atrtod,strtol,strtoul的使用
- atol()函数一个可移植的版本
- 回调函数
- 给osk5912加上nand flash
- javascript获取textarea光标选择位置和内容方法(IE, Firefox)
- 拒绝了对对象 'sp_sdidebug'(数据库 'master',所有者 'dbo')的 EXECUTE 权限 解决方法
- .Net 图片验证码作法(C#版)
- atol的实现代码
- iBATIS
- lua源码分析之性能分析1(赋值研究)
- 鼠标滑过图片出现大图片提示层效果js代码
- 浅谈P2P终结者原理及其突破
- HPMC和LPMC
- solaris 10 zone 安装
- CSS实现图片超过限定尺寸自动缩放兼容IE和Firefox
- 【转帖】驱动开发学习笔记