πŸ“Š C++
Q. Which of the following is the correct way to define a destructor in C++?
  • (A) ~MyClass() { }
  • (B) void ~MyClass() { }
  • (C) int ~MyClass() { }
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) ~MyClass() { }

Explanation: The correct way to define a destructor is '~MyClass() { }'.

Explanation by: Ram Sharma
The correct way to define a destructor is '~MyClass() { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
120
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
93%
Success Rate