C++ examples for STL:string
Use overloaded string concatenation operator with a char * string
#include <iostream> #include <string> using namespace std; int main() /*from www . j a v a 2s .c o m*/ { string s1( "happy" ); string s2( " birthday" ); string s3; cout << "\n\ns1 += \" to you\" yields" << endl; s1 += " to you"; cout << "s1 = " << s1 << "\n\n"; }