⟩ In C++, what is a constructor, destructor?
In C++
Constructor:This is a member of class which involkes when the object is created.Purpose of constructor is to intialise the objects with required values.
Destructor: It is a member of class which involkes when the object is out of scope.The purpose of destructor is to clear the heap memory.