This is the home page for Peter Chapin's C++ Programming course notes for the Fall 2023 semester. Here you will find electronic versions of class slides, homework assignments, program samples, and links to other references of interest. If you are a student taking C++ Programming, you should bookmark this page.
The course syllabus gives an overview of the course and its content, list course resources, and describes the grading policy and related issues.
I have some notes on C++ development environments that you can use for this course. Be advised, however, that your programs will be tested using g++ on Lemuria. Be sure to check that your programs behave properly in that environment before you submit them!
The homework submission area and grade book are on Canvas. All other course resources are here.
I have an incomplete tutorial on C++ that contains some material and sample programs of interest. My tutorial covers C++ 1998.
I also have a tutorial on C that you might find useful. Modern C++ is not just an enhancement to C, so leaning too much on your C background might be counter-productive. Nevertheless, we will reference many concepts from C.
I've prepared some general information on submitting assignments.
My home page contains other resources of potential interest.
The list below gives topics covered in each lecture. You can use this information to guide your study or to get an idea about what was covered in any missed lectures.
std::string
and std::vector
using the skeleton samples. Discussed Homework
#1.
const
using the basic
samples.
const
. Some comments on type
safety with respect to const
. I also have some notes on const
parameters to functions (a
relatively exotic topic).
std::string
class in the C++ library and explore the differences between strings in C++ and C. See also my
std::string Quick Reference Card.
std::vector
template in the C++ library and explore the differences between vectors in C++ and arrays in
C. It also explores various ways of initializing objects.
range_based_loops.cpp
file
contains material on range based for
loops.
notes-oop.hpp
, notes-oop.cpp
). These notes demonstrate some of
C++'s basic facilities for doing OOP.
During this class, I may use some programs and libraries I have written as samples.
The types.cpp program prints the ranges used by your compiler's primitive types.
The basic "Hello, World" sample provides build control files for make and several other build systems. You can use this sample as a starting point for your own projects.
Skeleton programs provide the basic structure for making simple filters that process a text file character-by-character or line-by-line, along withe some demonstration programs.
Programs that demonstrate the basic concepts of const and references.
The Date zip archive contains three versions of a class for manipulating calendar dates. Each version enhances the previous version. Demonstration programs are also provided.
The BigInteger sample demonstrates the lifecycle methods in the context of a class that handles arbitrary precision unsigned integers.
The Templates sample contains several (unrelated) function templates and some demonstration programs that illustrate various template features.
The Thread sample demonstrates how to create threads and use some of their features.
See my Development Environments page for notes about various C/C++ development environments with notes about how to install, configure, and use them. The links below are specifically for C++ compilers.
GCC, the GNU Compiler Collection. Technically, gcc is a front-end program that can run compilers for several languages. As a convenience, g++ runs the gcc C++ compiler.
Clang is an alternate, open-source compiler that includes support for C and C++. It is used by default on Apple Macs, but it is available for a wide variety of systems. Clang uses the advanced LLVM back-end technology.
Open Watcom only supports C++ 1998, but can target several legacy systems as well as modern Linux and Windows.
Some examples later in this class will push the envelope of C++ by exercising features from the latest standards that are not yet well-supported by commonly available compilers. However, using Docker, we can install "containers" with the absolute latest versions of gcc and clang. Setting up Docker is itself somewhat complicated, but also a valuable skill. We may discuss the details of doing this later in the class.
Last Revised: 2023-12-05
Copyright 2023 by Peter Chapin <peter.chapin@vermontstate.edu>