Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

string_class

#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;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.