C++ examples for STL:string
Assign one string to another
#include <iostream> #include <string> using namespace std; int main()//from w ww . ja va2 s . c o m { string str1("Alpha"); string str2("Beta"); string str3("Gamma"); string str4; str4 = str1; cout << "str4 after being assigned str1: " << str4 << "\n\n"; return 0; }