int转string
include <sstream>
int n = 0;
std::stringstream ss;
std::string str;
ss<<n;
ss>>str;
string转int
include<stdlib,h>
std::string str = "123";
int n = atoi(str.c_str());
将string每个字符都转化为int
string str = "123456";
for (int i = 0; i < str.length(); i++)
{
int a = str[i] - '0';
printf("%d \n", a);
}