Which among the following best describes destructor?

Trung Minh

New member
Which among the following best describes destructor?
A. A function which is called just before the objects are destroyed
B. A function which is called after each reference to the object
C. A function which is called after termination of the program
D. A function which is called before calling any member function
 
Answer: a
Explanation: The Destructors are special functions which are called just before an object is destroyed. This functions is responsible to free all the allocated resources to the object. Objects are destroyed whenever those go out of scope.
 

Tìm kiếm

Back
Top