# Explain the default action of the copy constructor. Write a suitable program that demonstrates the technique of overloading the copy constructor.

A constructor is a special member function used to initialize objects of its class. It will be called automatically when the object is created.

A class with two or more construct functions with the same name but with different parameters or arguments and other data types is called  Constructor overloading.

A copy constructor is a method or member function which initialize an object using another object within the same class.

Example:

#include <iostream>
using namespace std;

class ABC
{
public:
int x;

// this is parameterized constructor
ABC(int a){
x = a;
}

// this is copy constructor
ABC(ABC &i){
x = i.x;
}
};

int main()
{
// Calling the parameterized constructor.
ABC a1(40);

// Calling the copy constructor.
ABC a2(a1);

cout << a2.x;
return 0;
}