xSKILLby Infirals
Register

C++ for Beginners

C++24 lessons4 hr 53 min

Learn C++ by building small programs, then use functions, classes, and the standard library to organize them.

Modules

Lessons open in reading order. Each one is a public page.

Starting out

6 lessons

Compile a first program, learn the syntax and types it uses, then make decisions, repeat work, and keep many values together.

  1. How C++ becomes a program10 min
  2. The shape of a C++ program9 min
  3. Variables, types, and constants12 min
  4. Operators and decisions11 min
  5. Loops and repetition11 min
  6. Arrays and vectors12 min

Functions and library types

5 lessons

Move repeated work into functions, pass data by reference instead of copying it, and use vector, string, and algorithms from the standard library.

  1. Functions that do one job12 min
  2. STL basics: vector and string13 min
  3. Pointers and references compared12 min
  4. Functions that change their arguments12 min
  5. Overloads and default arguments11 min

Classes and object lifetime

4 lessons

Group state with the functions that act on it, keep objects valid from construction to destruction, and expose only what callers should change.

  1. Classes and objects14 min
  2. Constructors, destructors, and lifetime13 min
  3. this, static members, and factories12 min
  4. Const correctness and encapsulation12 min

Inheritance, operators, and templates

5 lessons

Derive one type from another, make operators read like the built-in ones, and write templates that serve several types.

  1. Base and derived classes12 min
  2. Virtual functions and overriding13 min
  3. Abstract classes and multiple inheritance13 min
  4. Operator overloading13 min
  5. Function and class templates13 min

Exceptions, STL, and ownership

4 lessons

Report failures with exceptions, look values up in maps and sets, swap loops for standard algorithms, and let a smart pointer own heap memory while you read and write files.

  1. Exceptions: throw, catch, unwind13 min
  2. Maps, sets, and iterators13 min
  3. Algorithms and the string class13 min
  4. Files, namespaces, and unique_ptr14 min
All notes

Sign in, then read a note for 45 seconds or press Mark as read. Reading progress appears on the notes home and your dashboard.