{
str_type temp;
strcpy(string, str);
strcpy(temp.string, string);
return temp;
}
str_type str_type::operator+(char *str)
{
str_type temp;
strcpy(temp.string, string);
strcat(temp.string, str);
return temp;
}
int main()
{
str_type а("Привет "), b("всем"), с;
с = а + b;
с.show_str();
cout << "\n";
а = "для программирования, потому что";
а.show_str();
cout << "\n";
b = с = "C++ это супер";
с = c + " " + а + " " +b;
с.show_str();
return 0;
}
При выполнении эта программа отображает на экране следующее.
Привет всем
для программирования, потому что