如何将 char a[0] 转换为 int b[0] 其中 b 是一个空的动态分配的 int 数组
我努力了
char a[] = "4x^0";
int *b;
b = new int[10];
char temp = a[0];
int temp2 = temp - 0;
b[0] = temp2;
我想要 4 但它给了我 ascii 值 52
也在做
a[0] = atoi(temp);
给我错误:从'char'到'const char*'的无效转换初始化'int atoi(const char*)'的参数1</p>