atoi()函数解释
来源:互联网 发布:淘宝海景房店铺氛围图 编辑:程序博客网 时间:2024/05/21 16:24
原型:int atoi (const char *nptr)
用法:#include <stdlib.h>
功能:将字符串转换成整型数;atoi()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负号才开始做转换,而再遇到非数字或字符串时('\0')才结束转化,并将结果返回。
说明:atoi()函数返回转换后的整型数。
举例:
#include <stdio.h> #include <stdlib.h> int main() { char a[] = "-10"; char b[] = "60"; int c = 0; c = atoi(a) + atoi(b); printf("c = %d\n",c); }
运行结果:
c = 50
0 0
- atoi()函数解释
- atoi函数
- atoi函数
- atoi () 函数
- atoi函数
- atoi()函数
- atoi 函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi函数
- atoi()函数
- atoi函数
- atoi函数
- atoi()函数
- morse
- 字符串总结(KMP)
- MikTex+TexStudio配置
- FZU 2185 树的路径覆盖 dfs深搜
- Javaweb学习笔记5—Cookie&Session
- atoi()函数解释
- Maurits Cornelis Escher
- 循环-04. 验证“哥德巴赫猜想”(20)
- O(1)时间复杂度逆序栈和排序栈
- Codeforces Round #297 (Div. 2)B Pasha and String
- 【Financial Markets】1. EONIA swap
- 阿里云管理终端总是黑屏
- Javaweb学习笔记6—EL表达式与JSTL及自定义标签
- 我的技术路