+ 5
Could anyone answer my Q:
what do we mean when we say : "the Assignment Operator (=) by Default performs Memberwise Assignment..??
4 ответов
+ 4
assignment operator (=)sets left member value to value you give at right side
+ 4
Just to add - it means 'by default' because you can define how the assignment operator works with your own classes. And memberwise assignment means the objects directly to the left and right of the operator (equals sign).
"By default, such assignment is performed by memberwise assignment (also called copy assignment)—each data member of the object on the right of the assignment operator is assigned individually to the same data member in the object on the left of the assignment operator."
+ 3
welcome RiGel
+ 2
adithya213 thanks Bro