Skip to content
Pebellslearn by building

The course

C++

Learn what makes C++ fast and demanding, set up a compiler, and write real programs with operators, branches, loops, pointers, references and types. Every lesson builds on one small arcade game, Rocket Run.

Ready to learn

Your path through the ideas

Inside the course

7 modules · 20 lessons
CLI tools & setup · Start here

Install your tools, choose your setup and verify a local run.

02Introduction to C++3 lessons

C++ is a compiled language that combines low-level control with abstractions such as classes, templates and automatic resource management. Meet the language behind game engines and browsers: how it turns source into machine code, the trade it asks you to make, and what it added on top of C.

  1. 01What Is C++?12 min
  2. 02Why Use C++12 min
  3. 03C vs C++12 min
03Setting Up Your Environment3 lessons

A C++ toolchain compiles source files, links their dependencies and produces an executable that can run on its target system. Install a compiler, choose an editor or IDE, and compile and run Rocket Run's first line of output, reading compiler errors the fast way.

  1. 01Installing a Compiler12 min
  2. 02Code Editors and IDEs12 min
  3. 03Running Your First Program12 min
04Basic Operations3 lessons

Basic operations use operators to calculate values, combine conditions and manipulate integer bits. Predict what arithmetic, logical and bitwise operators produce: integer division, short-circuit conditions and power-up flags packed into one number.

  1. 01Arithmetic Operators12 min
  2. 02Logical Operators12 min
  3. 03Bitwise Operators12 min
05Control Flow and Statements3 lessons

A statement performs an action. Control-flow statements select branches, repeat work or leave a loop. Choose between branches with if, else and switch, know when goto is acceptable, and pick the right loop for counting, waiting and asking at least once.

  1. 01if and else12 min
  2. 02switch and goto12 min
  3. 03for, while and do-while12 min
06Pointers and References4 lessons

A pointer stores an address and can be changed to point elsewhere. A reference provides another name for an existing object; both require attention to the object's lifetime. Use raw pointers and references to work on the original object instead of a copy, then learn where objects live in memory and the exact moment each one is destroyed.

  1. 01Raw Pointers12 min
  2. 02References12 min
  3. 03The Memory Model: Stack, Heap and Static12 min
  4. 04Lifetime of Objects12 min
07Data Types4 lessons

A type determines which values and operations an expression supports. C++ checks most type rules before execution, with specific facilities for runtime alternatives. See how static typing protects you, let auto deduce types, carry changing types safely with std::variant and std::any, and ask an object its real type with RTTI.

  1. 01Static Typing12 min
  2. 02auto — Letting the Compiler Deduce12 min
  3. 03Dynamic Typing with variant and any12 min
  4. 04RTTI — Asking a Type at Run Time12 min
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.