Skip to Content
Introduction to Design Patterns in C++ with Qt, 2nd Edition
book

Introduction to Design Patterns in C++ with Qt, 2nd Edition

by Alan Ezust, Paul Ezust
September 2011
Intermediate to advanced
768 pages
15h 18m
English
Pearson
Content preview from Introduction to Design Patterns in C++ with Qt, 2nd Edition

Chapter 2: Top of the class

This chapter provides an introduction to classes and objects and how member functions operate on objects. Classes and objects can be arranged in different structures, and this chapter presents some ways to describe the relationships between them. UML is introduced. static and const members are explained. Constructors, destructors, copy operations, and friends are discussed.

2.1 First, There Was struct

In the C language, the struct keyword enables the programmer to define a structured chunk of memory that can store a heterogeneous set of data. Example 2.1 shows the definition of a structured piece of memory composed of smaller chunks of memory.

Example 2.1 src/structdemo/demostruct.h

[ . . . . ]struct Fraction {    int ...

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

An Introduction to Design Patterns in C++ with Qt 4

An Introduction to Design Patterns in C++ with Qt 4

Alan Ezust, Paul Ezust
Programming with Qt, 2nd Edition

Programming with Qt, 2nd Edition

Matthias Kalle Dalheimer

Publisher Resources

ISBN: 9780132851619Purchase book