Modern C++ through practical projects
Refresh C++ by building small programs you can read, change, and explain.
For an experienced C programmer returning to C++ after working with classes and templates in the mid-1990s.
Start Lesson 1: Let scope do the cleanup
Build a small file reader and learn how local objects release resources, including when a function returns early. Predict the cleanup order, change the code, then explain it from memory.
Go to the exercises or keep the lifetime and cleanup reference open for lookup.
Bring your answers or changed source back to chat for review. Ask followup questions whenever an explanation or compiler message is unclear. What you can do with this lesson will guide the next one.
A provisional project sequence
Lesson 1 begins the first stage below. The remaining topics are future teaching directions; their lessons will be added as you progress. Each stage will use short lessons with exercises.
| Practical work | C++ ideas it introduces |
|---|---|
| Read and filter text files | Resource lifetime, strings, containers, references |
| Summarize and sort records | Values and copies, algorithms, lambdas |
| Build a small reusable library | Ownership transfer, move operations, error handling |
| Generalize useful operations | Templates, concepts, compile-time work |
| Extend a project where useful | Ranges, concurrency, newer standard-library features |