25
10/2014
C++任意类型转化成字符串
#include <iostream> #include <string> #include <sstream> int main(int argc, char** arg){ using namespace std; string s1 = "1"; ostringstream os; os << s1 << 1 << "---" << 0.235; s1 = os.str(); cout << s1 << endl; getchar(); return 0; }
转载请注明:康瑞部落 » C++任意类型转化成字符串
0 条评论