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

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -