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){}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

Create your own website, free on WordPress.com.Create your own website.
Start free