string 转 int,int 转 string

string str="12345";
int b=atoi(str.c_str());

可以配合atof,转为double

char buf[10];
sprintf(buf, "%d", 100);
string b = buf;
原文地址:https://www.cnblogs.com/zhxshseu/p/5293998.html