© Ivor Horton and Peter Van Weert 2020
I. Horton, P. Van WeertBeginning C++20https://doi.org/10.1007/978-1-4842-5884-2_12

12. Defining Your Own Data Types

Ivor Horton1  and Peter Van Weert2
(1)
Stratford-upon-Avon, Warwickshire, UK
(2)
Kessel-Lo, Belgium
 

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.

In this chapter, you’ll learn
  • What the basic principles in objected-oriented programming are

  • How you define a new data type as a class and how you can create and use objects of a class type

  • What the different building blocks of a class are—member variables, member functions, class constructors, ...

Get Beginning C++20: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.