atoi
atoi()函数将数字格式的字符串转换为整数类型。例如,将字符串“12345”转换成数字12345。
头文件:#include <stdlib.h>
函数原型:int atoi(const char *nptr);
char arr1[] = "2145";
int int_arr;
int _arr=atoi(arr1)
atol
atoi()函数将数字格式的字符串转换为long类型。例如,将字符串“12345”转换成数字12345。
函数原型:long atol(const char *nptr);
atoll
函数原型:long long atoll(const char *nptr);
atoq
函数原型:long long atoq(const char *nptr);