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 comment

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

Blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started