In C++, what is a member function with the same name as its class, preceded by a tilde (~), called?
Correct answer B. Destructor
Explanation
A destructor, written as ~ClassName(), is called automatically when an object goes out of scope or is deleted, to release resources.
Answer checked How we write and check questions
Discussion