// mushing everyting into one file for easier demonstration 
#include<iostream>
#include<string>
using namespace std ; // this is a dangerous thing to place in a header
                      // because it is applied to everything that includes this header
                      // you can break files that count on proper scope resolution 
class Animal{
    string name ;
    int age  ;

public :
    int a[] ;
    Animal(string name , int age ):name(name) ,age(age) {}
    Animal(const Animal & other);
    Animal& operator=(const Animal & other);
};

//#include <bits/stdc++.h> don't use stuff from bits. The are internal implementation headers
#include<sstream>

int main(){

    Animal elephant("ele" ,12);
    Animal cow("cow" ,22) ;
    cow = elephant ;
    cow.a[0]=5 ;
    return 0 ;
}

Animal::Animal(const Animal & other){
    cout<<"copy constructor is called"<<endl ;
    this->age=other.age ;
    this->name = other.name ;
}
Animal & Animal::operator=(const Animal & other){
    cout<<"Assignment operator is called"<<endl ;
    this->age=other.age ;
    this->name = other.name ;
}