atoi函数的功能是什么?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/04 19:34:35
atoi函数的功能是什么?

atoi函数的功能是什么?
atoi函数的功能是什么?

atoi函数的功能是什么?
C语言库函数名:atoi
  功 能:把字符串转换成整型数.
  名字来源:array to integer 的缩写.
  原型:int atoi(const char *nptr);
  函数说明:参数nptr字符串,如果第一个非空格字符不存在或者不是数字也不是正负号则返回零,否则开始做类型转换,之后检测到非数字(包括结束符 \0) 字符时停止转换,返回整型数.
从字符串中提取数据也可以用sscanf,功能与scanf类似.