Skip to Content
C++20 for Programmers: An Objects-Natural Approach, 3rd Edition
book

C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

by Paul Deitel, Harvey Deitel
April 2022
Intermediate to advanced
1012 pages
38h 1m
English
Pearson
Content preview from C++20 for Programmers: An Objects-Natural Approach, 3rd Edition

9. Custom Classes

Objectives

In this chapter, you’ll:

  • Define a custom class and use it to create objects.

  • Implement a class’s behaviors as member functions and attributes as data members.

  • Access and manipulate private data members through public get and set functions to enforce data encapsulation.

  • Use a constructor to initialize an object’s data.

  • Separate a class’s interface from its implementation for reuse.

  • Access class members via the dot (.) and arrow (->) operators.

  • Use destructors to perform “termination housekeeping” on objects that go out of scope.

  • Assign the data members of one object to those of another.

  • Create objects composed of other objects.

  • Use friend functions and declare friend classes.

  • Access non-static class members via ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Data-Intensive Applications, 2nd Edition

Designing Data-Intensive Applications, 2nd Edition

Martin Kleppmann, Chris Riccomini

Publisher Resources

ISBN: 9780136905776