First page Back Continue Last page Graphics
Object Assignment
You can assign one object to another object as long as they are both instantiated from the same class.
By default, C++ copies the contents of each data member from source to target.
- target_object = source_object;
Can be done in instantiation statement.
- Stock target_object ( source_object);
You can write your own “copy constructor” also. (later)