Skip to content

Last updated:2026-10-13

C++ Ten-Day Crash Course Exercises

Basic C++ syntax

Recursion, structs, enums, static variables, and more

Functions

Functions in depth

Inheritance and polymorphism

Virtual functions, abstract classes

Operator overloading

Templates and the STL

Exceptions

Files and streams

Daily Exercise Descriptions

The exercises are simply each day's file names + the comments inside the files, summarized in the table below. When practicing, first read the exercise name and write your own implementation, then compare it with the implementation in the repository:

Day Topic Exercises (corresponding repository files)
1 Basic syntax Comment alignment, printed output, leap-year checking, a first look at union
2 Recursion/structs/enums Tower of Hanoi, exponentiation, recursion basics, a simple calculator, enum applications
3 Functions Function overloading, default arguments, comparing pass-by-value/reference/pointer
4 Functions in depth Function pointers, callbacks, variadic parameters, inline functions
5 Classes and objects Constructors/destructors, access control in inheritance, operator overloading, composition, a first look at virtual functions
6 Inheritance and polymorphism Virtual functions, abstract classes, pure virtual functions, a comprehensive polymorphism case
7 Operator overloading Arithmetic/relational/subscript/parentheses overloading, conversion operators
8 Templates and the STL Class templates, function templates, an introduction to STL containers
9 Exceptions try/catch, custom exceptions, exception safety
10 Files and streams File reading and writing, stream formatting

Comments