plz chk i want to overload compound assignment operator bt its gving me some error
#include <iostream>
using namespace std;
class strng
{
char s[30];
public:
strng()
{
strcpy(s,"");
}
void getstring()
{
cout<<"enter the sting:";
cin>>s;
}
void displaystring()
{
cout <<"the string is:"<<s<<endl;
}
string operator +=(string &t);
};
string strng:: operator +=(string &t)
{
strng str;
strcpy (str.s,"");
strcat (str.s,s);
strcat (str.s,s.t);
return s;}
main
{
string string1;
string string2;
string1.getstring();
string2.getstring();
string string1=string1+string2;
string1.displaystring();
}