Question: a . Overload the operator + for the class newString to perform string concatenation. For example, if s 1 is Hello and s 2

a. Overload the operator + for the class newString to perform string concatenation. For example, if s1 is "Hello " and s2 is "there", the statement
s3= s1+ s2;
should assign "Hello there" to s3, where s1, s2, and s3 are newString objects. (6)
b. Overload the operator += for the class newString to perform the following string concatenation. Suppose that s1 is "Hello " and s2 is "there". Then the statement
s1+= s2;
should assign "Hello there" to s1, where s1 and s2 are newString objects. (6)
Submit your answer to dropbox.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!