Thursday, July 9, 2009

C++ and operator overloading?

I CAN'T FIGURE THIS OUT!!





In some applications, it is desirable to produce a concatenated String object without modifying the String arguments. Implement operator+ to allow operations such as





string1 = string2 + string3

C++ and operator overloading?
Use append(). And remember that





a + b





is the same as





operator+(a, b)





So implement a function named operator+ with the following signature:





string%26amp; string::operator+(string%26amp; s1, string%26amp; s2);

local florist

No comments:

Post a Comment