Copy constructor is used to copy the data of one object which already exists to the new object that is the reason why it is known as copy constructor.
E.g.:
class counter
{
int count;
Public:
counter(int c)
{
count=c;
}
counter(counter &ob) //Copy constructor
{
cout<<”Constructor called”.
count=ob.count;
}
void show()
{
cout<<”\n count=”<