Get Mystery Box with random crypto!

In this program, we have used a copy constructor to copy the c | C

In this program, we have used a copy constructor to copy the contents of one object of the Wall class to another. The code of the copy constructor is:

Wall(Wall &obj) {
length = obj.length;
height = obj.height;
}

Notice that the parameter of this constructor has the address of an object of the Wall class.

We then assign the values of the variables of the obj object to the corresponding variables of the object calling the copy constructor. This is how the contents of the object are copied.