将char类型转换为int类型
#include <stdio.h>
int main()
{
char a[12]="123456";
int i=0;
int j=0;
while(a[i]!=0)
{
j=j*10+a[i]-'0';
i++;
}
printf("%d\n",j);
return 0;
}
标签:类型转换,10,int,char,类型,main
From: https://www.cnblogs.com/yesiming/p/17450121.html