Answers

Question and Answer:

  Home  Hardware and Software Design

⟩ 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.

 134 views

More Questions for you: