C函数
atoi,将字符串转成整型变量
itoa,将整型变量转成字符型
如:
#include
int main()
{
char chBuf[5];
int k;
k=10;
itoa(k,chBuf,10);
printf("字符串中存放值为:%s\n",chBuf);
k = atoi(chBuf);
printf("将字符串放在int变量k的值:%d \n",k);
return 0;
}
用sprintf(str,格式,需要转换的整形)
a.pushback(j);cout<<"a"<<"["<
我想这样是可以的吧a[0]='0'+10;