What is a copy constructor? How is it different from a clone
What is a copy constructor? How is it different from a clone?
A copy constructor is a member function that initializes an object using another object of the same class. It’s different from clone because it creates a new instance with the exact value and state as the original, while clone only copies values but not the state. Clone can also be overridden to perform deep copying or shallow copying depending on requirements, whereas copy constructors always perform a deep copy.

