View Single Post
Mentor
8Mar2012,06:34  
xpi0t0s's Avatar
Your chosen approach is not the correct one. Simply use the assignment operator:
Code:
string str1="Hello";
string str2=str1;
cout<<str2;
Output should be "Hello".