#include <iostream> using namespace std; class String { public: String(char* str) { str_obj=str; } String operator + (const String& str1) { String str_return; return strcat(this,str1); } private: std::string str_obj; }; int main() { String str1("char"); String str2("actor"); String str3=str1+str2; return 0; }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more