#include
#include
void main()
{
char a[] = "123456";//输入的数字字符串
int n;
n = atoi(a);
cout<}
#include
#include
#include
void main()
{
char s[] = "3321";
int len = sizeof(s)-1, n=0;
for (int i=0; i
n += (s[i]-48)*pow(10, len-i-1);
}
cout << n << endl;
char** s = "12345";
int a = atoi(s);
在头文件#include
用atoi这个函数