Discuss Forum
1.
which operator is used to declare the destructor in C++ ?
- A. #
- B. #
- C. #
- D. #
Answer: Option B
Explanation:
A destructor is a member function that is invoked automatically when the object goes out of scope or is explicitly destroyed by a call to delete. A destructor has the same name as the class, preceded by a tilde (~). For example, the destructor for class String is declared: ~String().
Post your comments here: