// demonstrates possible uses of concatenation // Mikhail Nesterenko // 10/14/2010 #include #include using std::cout; using std::endl; using std::string; int main () { string s1; s1 = "hell"; // this is allowed // at least one operand has to be a string variable // s1 = "hell" + "o" <-- this is not allowed! s1 = s1 + 'o'; // this is allowed s1 +="!"; // so is this cout << s1 << endl; }