Copy Constructor

It is a constructor that creates an object by copying variables from another object of same class or we can simply say that it copies the data from one object into another object of the same class. It is a parameterized constructor that contains a parameter of the same class type. Syntax Teacher(const Teacher & obj){}

Create a free website or blog at WordPress.com.

Up ↑

Create your website at WordPress.com
Get started