How one object of same class assign to the other object of the same class in c++? -
i know can directly assign same class objects in c++,but happen behind scene?
there's called "default copy-constructor" , "default assignment-operator". unless overload these methods in class, default behavior non-static members of class copied one-by-one source target class.
a little more: includes pointers, btw. why should overload these operators , follow rule of three if have pointers members.
Comments
Post a Comment