LearnFrenzy
Sign in Take a free test

Abstraction · Abstraction MCQ · Question 9

What does RAII abstract away? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 9 Back to Exercise

What does RAII hide from the user of a class like std::lock_guard or std::ifstream?

  • A The type of the resource
  • B The need to release the resource manually – the destructor does it on every path Correct
  • C The size of the object
  • D The constructor
Correct Answer: Option B

Release happens on normal exit, early return and exceptions alike.

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