Chapter 17. Encapsulation

Difficulty: 4

What exactly is encapsulation as it applies to C++ programming? What does proper encapsulation and access control mean for member data—should it ever be public or protected? This Item focuses on alternative answers to these questions, and shows how those answers can increase either the robustness or the fragility of your code.

Get Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.