The Complete C++ Learning Guide

C++ is a compiled, general-purpose language used in applications where performance, detailed control, or large software libraries matter, including games and systems software.

How C++ works

C++ supports several styles, including procedural and object-oriented programming. It gives you choices about how values are stored and how resources are managed, so learning safe defaults is important.

What you will learn

Start with no C++ experience and build toward advanced C++23: fundamentals, safe resource ownership, generic programming, concurrency, the memory model, build engineering, and research-style projects.

How to use this guide

  1. Start with Chapter 1 if you are new to programming. The lessons build from basic expressions and control flow toward systems concepts and advanced language design.
  2. Type each example yourself, make a small change, and predict what will happen before running it.
  3. Work through the chapters in order. Each chapter includes explanations, code examples, and exercises; compile examples with the standard mode supported by your toolchain.
  4. For advanced study, complete the final exercises, read the cited language and toolchain documentation, and validate claims with reproducible experiments.

A step-by-step learning path

  1. Chapters 1-7: Start from zero. Learn the toolchain, first program, types, input, expressions, control flow, and function contracts.
  2. Chapters 8-12: Work with data. Use arrays and standard containers, process strings, understand references and pointers, manage resources, and create classes and structs.
  3. Chapters 13-18: Understand program boundaries. Study lifetime, linkage, headers and modules, libraries and ABI, standard facilities, file formats, testing, and verification.
  4. Chapters 19-24: Move toward advanced practice. Reason about algorithms, templates, ranges, coroutines, concurrency, memory ordering, reproducible builds, capstones, and research methods.

A progression from beginner to advanced

  1. Foundation: compile and modify small programs; explain each expression, type, and control-flow path.
  2. Practitioner: build multi-file applications with standard containers, explicit ownership, tests, and documented failure behavior.
  3. Advanced: reason about object lifetime, templates and constraints, iterator invalidation, ABI, complexity, and concurrency guarantees.
  4. Research direction: formulate a narrow question, consult standard wording and implementation evidence, design reproducible experiments, and evaluate limitations. Doctoral-level expertise requires sustained study and original research beyond any single course.

C++ ideas you will meet early

Your first C++ program

Save this program as hello.cpp:

#include <iostream>

int main()
{
    std::cout << "Hello, world!\n";
    return 0;
}

#include <iostream> makes the standard output tools available. main is where this program starts. std::cout sends text to the terminal, and return 0 reports success. With a recent GCC or Clang compiler, build and run it in C++23 mode:

g++ -std=c++23 -Wall -Wextra -Wpedantic hello.cpp -o hello
./hello

Compiler commands and C++23 feature support differ across operating systems and toolchains. If your compiler does not yet support C++23, use the newest supported standard mode for the examples you are trying. On Windows, run the produced hello.exe file from a suitable terminal.

A simple way to study

First file: save your first program as hello.cpp. A typical GCC command is g++ -std=c++23 -Wall -Wextra -Wpedantic hello.cpp -o hello.

Course chapters

Follow the 24 chapters in order, or choose a topic to revisit. Each chapter opens its own lesson page.

  1. What C++ is and how a program runs
  2. Your first program
  3. Values, types, and variables
  4. Input and output
  5. Expressions and operators
  6. Decisions and loops
  7. Functions and program structure
  8. Collections: arrays, lists, and slices
  9. Strings and text
  10. References, pointers, and memory
  11. Memory and resource management
  12. User-defined types and data modeling
  13. Scope, lifetime, and visibility
  14. Modules, imports, and declarations
  15. Multi-file programs, packages, and libraries
  16. The standard library and ecosystem
  17. File input and output
  18. Errors, debugging, and testing
  19. Data structures and algorithms
  20. Advanced language topics
  21. Safety, portability, and performance
  22. Build systems and professional workflow
  23. A project ladder
  24. Further study checklist
0% read