Use string copy constructor - C++ STL

C++ examples for STL:string

Description

Use string copy constructor

Demo Code

#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"; 

}

Related Tutorials