C++ examples for STL:string
Concatenate two strings with plus operator
#include <iostream> #include <string> using namespace std; int main()// w ww . j av a 2s . co m { string str1("Alpha"); string str2("Beta"); string str3("Gamma"); string str4; str4 = str1; str4 = str1 + str3; cout << "str4 after begin assigned st1+str3: " << str4 << "\n\n"; return 0; }