Programming in C++

Access the lecture slides via Google Books or Google Play Books.

Table of Contents

Other Textbooks by the Author

The author also has the following (open-access) textbooks:

About the Lecture Slides

For additional information about the contents of the lecture slides, refer to the Lecture Slides Abstract section.

About the Author

For more details about the author, please visit his home page.

Lecture Slides Abstract

This document constitutes a detailed set of lecture slides on programming using the C++ programming language. The topics covered are quite broad, including the history of C++, the C++ language itself, the C++ standard library and various other libraries, and software tools, as well as numerous other programming-related topics. Coverage of C++ is current with the C++14 standard.

Many aspects of the C++ language are covered from introductory to more advanced. This material includes: language basics (objects, types, values, operators, expressions, control-flow constructs, functions, and namespaces), classes, templates (function, class, alias, and variable templates; template specialization; and variadic templates), lambda expressions, inheritance and run-time polymorphism, exceptions (exception safety, RAII, and smart pointers), rvalue references (move semantics and perfect forwarding), concurrency (sequential consistency, atomic memory operations, data races; threads, mutexes, condition variables, promises and futures, atomics, and fences; happens-before and synchronizes-with relationships; and sequentially-consistent and other memory models). A number of best practices, tips, and idioms regarding the use of the language are also presented. Some aspects of the C++ standard library are covered, including: containers, iterators, and algorithms; the std::vector and std::basic_string classes; I/O streams; time measurement; and smart pointers. Various general programming-related topics are also presented, such as material on: good programming practices, finite-precision arithmetic, software documentation, software build tools (such as CMake and Make), and version control systems (such as Git).

Lecture Slides License

The lecture slides are licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. This license allows for a work to be distributed freely, subject to certain quite reasonable conditions (e.g., no commercial use). Refer to the above link for more details on the license.
License Logo

Obtaining the Lecture Slides (E-Book and Print)

All versions of the lectures slides that are currently available are listed below. All versions of these documents are available in electronic form (i.e., PDF format) for download from this web page. (See below.) Some versions of these documents are also available in print form via online order from the University of Victoria Bookstore.

The available versions of the lecture slides are as follows:

Git Repository

The lecture slides have a companion Git repository that is hosted by GitHub. This repository contains numerous code examples and programming exercises. The URL for the main web page associated with the repository is:

The URL for the Git repository itself is:

Join the Google Group for the Lecture Slides

If you find these lecture slides useful (as a student, instructor, or otherwise), the author would ask that you please consider joining the (moderated) Google Group for announcements regarding these lecture slides. This will benefit you by allowing you to receive notifications of new releases of the lecture slides. To join the Google Group for the lecture slides, simply enter your email address in the box below and click on the "Subscribe" button.

Google Groups
Subscribe to An Introduction to the C++ Programming Language Lecture Slides Announcements
Visit this group

Video Presentations

The following video presentations are available for the lecture slides:

  1. Software Tools
    1. Getting Started (Compiling and Linking C++ Programs)
  2. Basics
    1. Introduction
    2. Objects, Types, and Values
    3. Operators and Expressions
    4. Control-Flow Constructs
    5. Functions
    6. Input/Output (I/O)
    7. Miscellany
  3. Classes
    1. Introduction
    2. Members and Access Specifiers
    3. Constructors and Destructors
    4. Operator Overloading
    5. More on Classes
    6. Temporary Objects
    7. Functors
  4. Templates
    1. Introduction
    2. Function Templates
    3. Class Templates
    4. Variable Templates
    5. Alias Templates
  5. Lambda Expressions (coming soon)
  6. Classes and Inheritance (coming soon)
  7. Standard Library
    1. Introduction
    2. Containers, Iterators, and Algorithms
    3. The vector Class Template
    4. The basic_string Class Template
    5. Time Measurement
  8. Exceptions (coming soon)
  9. Rvalues References (coming soon)
  10. Concurrency
    1. Preliminaries
    2. Threads
    3. Mutexes
    4. Condition Variables
    5. Promises and Futures
    6. Atomics (coming soon)
    7. More Atomics (coming soon)
  11. Computational Geometry Algorithms Library (CGAL)
    1. Introduction
    2. Polygon Meshes
    3. Surface Subdivision Methods
    4. Example Programs for Polygon Meshes
  12. Open Graphics Library (OpenGL)
    1. Introduction
    2. GLUT
    3. (Legacy) OpenGL (Note: A new version of this video using new slides based on shaders is in preparation.)
    4. (Legacy) OpenGL Example Programs (Note: A new version of this video using new slides based on shaders is in preparation.)
  13. Signal Processing Library (SPL)
    1. Introduction
  14. Version Control Systems (Git)
  15. Build Tools (Make and CMake)

Other Video Presentations

Some video presentations by others (i.e., not by the author of this page) that may be of interest are as follows:

  1. The Basics of Git and GitHub (July 2013)
  2. Subversion (Version Control System)

Additional References

Some other references that may be helpful are as follows:

  1. Video lectures for MIT OCW course on algorithms (Fall 2011).
  2. Video lectures for MIT OCW course on algorithms (Fall 2005).
  3. Video lectures for MIT OCW course on advanced data structures (Spring 2012).