Question: Why do we need to overload the assignment operator in some class interfaces, such as in String& String::operator = ( const String& other ) ?

Why do we need to overload the assignment operator in some class interfaces, such as in String& String::operator=(const String& other)?
To delete (free) unused memory pointed to by the object
To copy buffers used by both the object on the left and the object on the right side of the equals
To prevent memory leaks
All of these
 Why do we need to overload the assignment operator in some

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To overload the assignment operator in class interfaces like String Strin... View full answer

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 Databases Questions!