标签:int c_str ios ring str highlight out ace asi
#include <iostream> #include <string> #include <sstream> using namespace std ; void i2s(int x, string &basic_string) { stringstream ss; ss << x; ss >> basic_string; } void s2i(string &basic_string , int &x ) { stringstream ss; ss << basic_string; ss >> x; } void c2s(char c , string & s){ stringstream stream; stream << c; s = stream.str(); } int main(){ string str = "123"; int c ; s2i(str , c); cout << c ; }
标签:int c_str ios ring str highlight out ace asi
原文地址:https://www.cnblogs.com/Stephen-Jixing/p/12628325.html