c++primer chapter 8 stringstream 提供的转换或格式化
[cpp]
#if 1
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
int val1 = 512, val2 = 1024;
ostringstream format_message;
format_message << "val1: " << val1 << "\n"
<< "val2: " << val2 << "\n";
istringstream input_istring(format_message.str());
string dump1, dump2;
input_istring >> dump1 >> val1 >> dump2 >> val2;
cout << val1 << " " << val2 << endl;
cout << format_message.str();
cout << dump1 << dump2 << endl;
}
#endif
补充:软件开发 , C++ ,