Get Mystery Box with random crypto!

In main(), we then create two objects wall1 and wall2 and then | C

In main(), we then create two objects wall1 and wall2 and then copy the contents of wall1 to wall2:

// copy contents of wall1 to wall2
Wall wall2 = wall1;

Here, the wall2 object calls its copy constructor by passing the address of the wall1 object as its argument i.e. &obj = &wall1.

Note: A constructor is primarily used to initialize objects. They are also used to run a default code when an object is created.