C++ Tutorial

© Copyright 2016 by Peter C. Chapin
Last Revised: January 2016


Introduction

The documents linked to this page constitute the "lectures" of a one-semester course in the C++ programming language. I created these documents myself and have used them in programming classes at Vermont Technical College, where I am an instructor. I am posting these documents on the web for public access under the terms of the GNU Free Documentation License (GFDL).

Permission is granted to copy, distribute and/or modify this document (and the related subordinate documents as described above) under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no invariant sections, no front-cover texts, and no back-cover texts.

If you make corrections or enhancements to any of these documents, I encourage you to contact me so that I can consider incorporating your enhancements into my copy as well. It is my hope that in this way on-line educational resources, such as these documents, can benefit from the same process that has made open source programming projects such a success.


Lessons

This course assumes as a prerequisite that you are familiar with C. Teaching C++ on top of a C background is somewhat controversial. Some C++ instructors believe that C++ is best taught on its own terms and not as an enhancement to C. Such an approach makes sense because C++ offers different (and better) ways of handling certain problems as compared to C. It can take a while for a seasoned C programmer to break old habits and really start using C++ to its full potential. However, at Vermont Technical College we teach plain C in our introductory course because we believe there are still many contexts where plain C is all that is available and thus worth learning for its own sake. As a result, our C++ course assumes a solid C background.

C++ is an enormous language that can be used in many ways. It would be impossible for a single course to cover all of what is C++. In this course I focus on C++'s support for user defined types and object oriented programming. These are important facilities that are in wide use. However, there are many C++ features that I do not describe in detail here. In particular, this course is light on templates and generic programming. It is my hope, however, that after working through the lessons in this course you will be in a good position to study C++ templates from other sources.

I have broken all of this material into 30 lessons along with some supporting files. Each lesson builds on the previous lessons. I recommend that you read the lessons in order. However, if you have some previous C++ experience you may find it useful to skip around. In places where it matters, which are few, this course assumes you are using the gcc compiler on a Unix system. In addition this course assumes you are comfortable editing source code files with a good programmer's editor.

In addition to the lessons themselves I have also prepared several example programs to help illustrate some points and to show the features of C++ in a more realistic way. In the list below I show links to these examples as well as to the lesson text. Each example is associated with a particular lesson. You should review an example after you've read the corresponding lesson text.

I have also created three review lessons that highlight essential topics from C that you need to know before you'll be able to make sense of the materials in this course. These three review lessons are shown below just before the main list of lessons for this course. If you are interested in my full C course, see the links at the bottom of this page.

The following lessons contain the content of this course


Videos

The following videos contain various bits of tutorial information. Some of the videos are of a fairly advanced nature.


Slides

The following slides provide supplementary information about various C++ topics.


Links

The following links provide access to potentially useful resources about C++. If you find a resource that is particularly valuable, let me know and I'll consider adding it to this list.


© Copyright 2016 by Peter C. Chapin.
Last Revised: January 12, 2016