LearnFrenzy
Sign in Take a free test

Constructors and Destructors · Constructors MCQ · Question 10

What does the rule of three say? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 10 Back to Exercise

What is the rule of three?

  • A Every class needs three constructors
  • B A class that needs a custom destructor, copy constructor or copy assignment usually needs all three Correct
  • C Classes should have at most three members
  • D Use three levels of inheritance
Correct Answer: Option B

All three deal with the same owned resource. C++11 extends it to the rule of five with the move operations.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links