This page provides links to source code for each text (where available) and also presents programs which correct errors or which extend examples given in his books.
Source Code for Books
C++ for C Programmers, Second Edition
C++ for C Programmers, Third Edition
C++ for Pascal Programmers, Second Edition
Object-Oriented Programming Using C++, Second Edition
C++ Distilled: A Concise ANSI/ISO Reference and Style Guide
C by Dissection, Fourth Edition
This is a supplemental example showing the use of dynamic_cast
.
This code improves on the existing clock example. That example used different techniques such as member function overloading versus friend function overloading for didactic purposes. This version is more uniform.
This is an example of multiple inheritance mixin showing implementation and interface.
In C++ for C Programmers, C++ Distilled and Object-Oriented Programming Using C++, the mutable example uses a non-const member function incorrectly as was pointed out by Paul Ezust (see for example C++ for C Programmers, Third Edition p156.) The indicated change corrects the problem. The code in this example is a small variation on the book that incorporates the correction.
This is an example of all six STL String constructors.
This file includes a further explanation of lvalues and rvalues as well as a code example which demonstrates those differences.