- //文件名:CHAPTER2-16.cpp
- #include <string>
- #include <iostream>
- using namespace std;
- void main()
- {
- string Mystring1(10,' ');
- string Mystring2=" This is the example string!";
- string Mystring3(Mystring2);
- cout <<"string1 is :"<< Mystring1<<endl;
- cout <<"string2 is :"<< Mystring2<<endl;
- cout <<"string3 is :"<< Mystring3<<endl;
- Mystring3 = Mystring1;
- cout <<"string3 is :"<< Mystring3<<endl;
- }