#include <string>
#include <iostream>
int main ()
{
std::string str1 ("This is a C++ string! ");
std::cout << "str1 = " << str1 << std::endl;
std::string str2;
str2 = str1;
std::cout << "Result of assignment, str2 = " << str2 << std::endl;
str2 = "Hello string!";
std::cout << "After over-writing contents, str2 = " << str2;
std::string strAddResult = str1 + str2;
std::cout << strAddResult;
return 0;
}
|