Practice mode C++

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.