Computer Science, asked by arvind5700, 1 year ago

Why assignment operator cannot be overloaded in c++

Answers

Answered by Anonymous
6
Hey there!

--------

☆ Assignment Operators ☆

A statement which contains an assignment operator is called the assignment statement and it is used to store the value of an expression in the computer memory for further reference. In other words, an assignment operator is used to assign back to a variable, a modified value of the present one. The assignment statement is one of the most common statements in any computer programming language.

The symbol = is used as an assignment operator and it is evaluated at the last. Remember that equal to = is an operator and not an equation maker and hence, it can appear anywhere in place of another operator.



• The assignment operator is a unary operator because it is connected only to the entity on the right, which is the operand. Whenever an assignment operator is overloaded in a base class, it cannot be inherited in a derived class. Hence, the assignment operator which is to be overloaded must be either a method (or a member function) or a class object with arguments.
Similar questions