C++ examples for STL:string
Use string copy constructor
#include <iostream> #include <string> using namespace std; int main() //w w w . j a v a2s. c om { string s1( "happy" ); string s2( " birthday" ); string s3; string s4( s1 ); cout << "\ns4 = " << s4 << "\n\n"; }