atoi自实现
来源:互联网 发布:spark大数据 编辑:程序博客网 时间:2024/05/17 14:24
int myatoi(const char *pszStr)
{
if (NULL == pszStr)
{
return 0;
}
int nTemp = 0, nResult = 0;
int i = 0;
BOOL bMinus = FALSE;
if ('-' == pszStr[0])
{
bMinus = TRUE;
i = 1;
}
while (pszStr[i] != '/0')
{
if (pszStr[i] >= '0' && pszStr[i] <= '9')
{
nResult = nResult * 10;
nTemp = pszStr[i] - '0';
nResult = nResult + nTemp;
}
else
{
break;
}
i++;
}
if (bMinus)
{
nResult = nResult * -1;
}
return nResult;
}
- atoi自实现
- atoi()函数自实现
- 自写atoi实现函数
- 如何自实现atoi函数(C/C++)
- LeetCode(atoi)实现atoi
- atoi实现
- atoi实现
- atoi 实现
- 实现atoi
- atoi实现
- 实现atoi
- atoi实现
- atoi实现
- atoi实现
- atoi实现
- atoi实现
- 自己实现atoi系列(atoi函数)
- atoi及itoa 实现
- pthread_cond同步
- centos(7) heartbeat 配置
- socket
- 关于cout执行顺序的问题
- 批量写入数据库
- atoi自实现
- datagridview清空数据
- hashtable 用法
- Android中的文件存储数据方式
- prolog语言
- CEGUI安装、编译、运行总结
- Android GridView 横向滚动 一行显示
- windows bugzilla server搭建
- ibaits-- 避免n+1 select (1:m;m:n)