#include #include #include using namespace std; int main() { double pi; stringstream ss ; ss << "3.14"; ss >> pi; cout << pi << endl; cout << "showpoint:" << showpoint << pi << endl; cout << ss.str() << endl; ss.clear(); //clearing ss << 3.15 << " " << "3.16"; cout << ss.str() << endl; ss.str(""); //clearing. ss << 3.15 << " " << "3.16"; cout << ss.str() << endl; ss.clear(); //clearing ss.str(""); //clearing. // from integer to charactor string ss << 123 << " NUMBER"; cout << ss.str() << endl; for( int i=0; i<10; i++ ){ ss.str(""); //clearing. ss << "sample" << i << ".dat"; cout << ss.str() << endl; } double ccc; ss>>ccc; cout << "char=" << ccc << endl; return 0; } ----------------------Œ‹‰Ê‚Í $ ./a.exe 3.14 showpoint:3.14000 3.14 3.143.15 3.16 3.15 3.16 123 NUMBER sample0.dat sample1.dat sample2.dat sample3.dat sample4.dat sample5.dat sample6.dat sample7.dat sample8.dat sample9.dat char=5.22202e-307