When are constructor and destructor called ?
Constructor are the the special function having name as that of the class and doesn't have any return type.Constructor is called when the object of the class is created .We can say if the object of the class is created the constructor function is automatically called.
Destructor are also function similar to the constructor that is has same name as that of the Constructor but precised with tilde (~) sign . The destructor is called if the scope of the constructor is finished .The purpose of calling Destructor is to release the resources used by the object of the class .
Constructor are the the special function having name as that of the class and doesn't have any return type.Constructor is called when the object of the class is created .We can say if the object of the class is created the constructor function is automatically called.
Destructor are also function similar to the constructor that is has same name as that of the Constructor but precised with tilde (~) sign . The destructor is called if the scope of the constructor is finished .The purpose of calling Destructor is to release the resources used by the object of the class .