一、vector<int>转换成string
1 std::stringstream ss; 2 string testString; 3 std::reverse_copy(result.begin(),result.end(),ostream_iterator<int>(ss,"")); 4 testString = ss.str();
二、string转换成int
string op; int temp; temp = atoi(op.substr(j,1).c_str());
1 std::stringstream ss; 2 string testString; 3 std::reverse_copy(result.begin(),result.end(),ostream_iterator<int>(ss,"")); 4 testString = ss.str();
string op; int temp; temp = atoi(op.substr(j,1).c_str());
转载于:https://www.cnblogs.com/timesdaughter/p/5650232.html