/* Ok I need help with this, I'll show you the main program and the constructor definition*/
int main()
{
String s1("initial test");
cout << "S1:\t" << s1.GetString() << endl;
char * temp = "Hello World";
s1 = temp;
cout << "S1:\t" << s1.GetString() << endl;
char tempTwo[20];
strcpy(tempTwo,"; nice to be here!");
s1 += tempTwo;
cout << "tempTwo:\t" << tempTwo << endl;
cout << "S1:\t" << s1.GetString() << endl;
cout << "S1[4]:\t" << s1[4] << endl;
s1[4]='x';
cout << "S1:\t" << s1.GetString() << endl;
cout << "S1[999]:\t" << s1[999] << endl;
String s2(" Another string");
String s3;
s3 = s1+s2;
cout << "S3:\t" << s3.GetString() << endl;
String s4;
s4 = "Why does this work?";
cout << "S4:\t" << s4.GetString() << endl;
return 0;
}
/* I need on this defintion, basically what is *this doing and what is assigned to what in terms of for example "s1" and '"s4" etc.*/
void String:perator+=(const String& rhs)
{
unsigned short rhsLen = rhs.GetLen();
unsigned short totalLen = itsLen + rhsLen;
String temp(totalLen);
unsigned short i;
for (i = 0; i<itsLen; i++)
temp[i] = itsString[i];
for (unsigned short j = 0; j<rhs.GetLen(); j++, i++)
temp[i] = rhs[i-itsLen];
temp[totalLen]='\0';
*this = temp;
}
THIS IS NOT THE WHOLE CODE