Chapter 2. Classes
This chapter provides an introduction to classes and objects, and how member functions operate on objects. UML is introduced. static
and const
members are explained. Constructors, destructors, copy operations, and friends are discussed.
Structs | ||
Class Definitions | ||
Member Access Specifiers | ||
Encapsulation | ||
Introduction to UML | ||
Friends of a Class | ||
Constructors | ||
Subobjects | ||
Destructors | ||
The Keyword static | ||
Copy Constructors and Assignment Operators | ||
Conversions | ||
const Member Functions |
Structs
In the C language, there is the struct
keyword, for defining a structured chunk of memory.
Example 2.1. src/structdemo/demostruct.h
[ . . . . ] struct Fraction { int numer, denom; string description; ...
Get An Introduction to Design Patterns in C++ with Qt 4 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.