Learn C++

Free C++ guides and exercises

These free C++ guides explain 17 practical topics with complete examples, expected output, and short exercises. Use them when you need a focused explanation of a language feature, runtime problem, or compiler message. Each guide names the cause early and shows how to inspect the code and correct it.

The guides group related material so you can follow a problem from one page to another. Start with containers and loops, then review input and strings when your program reads user data. Runtime guides explain invalid indexing and arithmetic boundaries. Compiler and linker guides help you interpret diagnostics, separate declaration mistakes from build errors, and understand how source files fit together. Every complete program targets C++17 and includes its expected output. Try an exercise after reading, then compare your approach with its optional solution. The pages provide a reference for your own programs and do not require an account to read.

Containers and loops

Input and strings

Runtime errors and undefined behavior

Compiler and linker errors

Compiler warnings