2076 5

CSC166 ยท 2076 ยท 5 marks

What is destructor? Write a program to show the destructor call such that it prints the message 'memory is released'.

What is destructor? Write a program to show the destructor call such that it prints the message 'memory is released'. [5]

Object Oriented ProgrammingChapter 3: Classes & ObjectsInitialization of class objects

A destructor is a special member function of a class that is automatically called when an object goes out of scope or is explicitly deleted. It is used to release memory and other resources that were allocated to the object during its lifetime. Feature Description ------ Name Same as class name, ...