c++ int转string
1 #include <iostream> 2 #include <string> 3 #include <algorithm> 4 #include <sstream> 5 using namespace std; 6 int main(){ 7 int i=2; 8 ostringstream os; 9 os<<i; 10 cout<<os.str(); 11 return 0; 12 }
1 #include <iostream> 2 #include <string> 3 #include <algorithm> 4 #include <sstream> 5 using namespace std; 6 int main(){ 7 int i=2; 8 ostringstream os; 9 os<<i; 10 cout<<os.str(); 11 return 0; 12 }