Copy constructor is invoked when a new object is created with the help of an existing object.Shallow copy occurs when a default copy constructor is used, and the objects point to the same memory location.Deep copy solves the issue of shallow copy by assigning a different memory location to the new object.To perform deep copy, a custom copy constructor needs to be defined.