Multiple choice

Whenever an object is destroyed which function will be invoked automatically?

  1. Constructor

  2. Allocator

  3. Destructor

  4. Manipulator

  5. Compiler

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Destructors are usually used to deallocate memory and do other cleanup for a class object and its class members when the object is destroyed.