atoi函数
来源:互联网 发布:知字取名 编辑:程序博客网 时间:2024/06/05 05:39
原型:
int atoi(const char *nptr);
atoi( ) 函数会扫描参数 nptr字符串,跳过前面的空白字符(例如空格,tab缩进等,可以通过isspace( )函数来检测),直到遇上数字或正负符号才开始做转换,而再遇到非数字或字符串结束时('\0')才结束转换,并将结果返回。如果 nptr不能转换成 int 或者 nptr为空字符串,那么将返回 0。
举例:
int main(void){ int n; char *str = "12345.67"; n = atoi(str); printf("int=%d\n",n); return 0;}
输出:
int = 12345
0 0
- atoi函数
- atoi函数
- atoi () 函数
- atoi函数
- atoi()函数
- atoi 函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi()函数
- atoi函数
- atoi函数
- atoi()函数
- atoi函数
- Softmax回归
- Android屏幕常亮设置
- mysql 字段类型
- 机器学习【2】牛顿迭代法
- iOS点击推送消息跳转到指定页面
- atoi函数
- spring框架的ioc和aop通俗解释
- 遇到crontab 自动任务导致服务器崩溃的情况
- localStorage 存储 数组
- 认清Android框架 MVC,MVP和MVVM
- 智能图书馆
- Linux struct file结构
- 树形数组的递归遍历
- LeetCode笔记:111. Minimum Depth of Binary Tree