Abstract
In this chapter, we’ll introduce one of the most fundamental tools in the C++ programmer’s toolbox: classes. We’ll also present some ideas that are implicit in object-oriented programming and show how they are applied.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
In the context of object-oriented programming, you’ll find that the term encapsulation may actually refer to two related yet distinct notions. Some authors define encapsulation like we do, namely, as the bundling of data with the functions that operate on that data, while others define it as a language mechanism for restricting direct access to an object’s members. The latter is what we refer to as data hiding in the next subsection. Enough ink has been spilled discussing which definition is right, so we will not go there—though obviously it’s ours. When reading other texts or when discussing with your peers, just keep in mind that encapsulation is often used as a synonym for data hiding.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Ivor Horton and Peter Van Weert
About this chapter
Cite this chapter
Horton, I., Van Weert, P. (2018). Defining Your Own Data Types. In: Beginning C++17. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3366-5_11
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3366-5_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3365-8
Online ISBN: 978-1-4842-3366-5
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books