LearnFrenzy
Sign in Take a free test

Abstraction · Abstraction MCQ · Question 7

Why use the pimpl idiom for abstraction? Answer, explanation & discussion

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

What is the main purpose of the pimpl idiom?

  • A Faster function calls
  • B Hiding private members from the header, so implementation changes do not force users to recompile Correct
  • C Avoiding the heap
  • D Making classes copyable
Correct Answer: Option B

It also keeps heavy #includes out of the header and gives a stable binary interface.

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