- #include<iostream>
- #include<cstdlib>
- #include<sstream>
- using namespace std;
- int main()
- {
- stringstream ss;
- string tim1="hello",
- tim2="world";
- ss<<tim1<<tim2;
- cout<<ss.str()<<endl;
- system("pause");
- return 0;
- }
複製代碼- #include<iostream>
- #include<cstdlib>
- #include<sstream>
- using namespace std;
- int main()
- {
- stringstream ss;
- string tim1="hello",
- tim2="world",
- tim3;
- ss<<tim1<<tim2;
- ss>>tim3;
- cout<<tim3<<endl;
- system("pause");
- return 0;
- }
複製代碼 |