Tutorial

C++ Tutorial

A hands-on C++ tutorial designed to get you job-ready. Covers tooling, memory management, OOP, modern C++, the STL, build systems, and best practices.

Tutorial·Difficulty: Intermediate·11 chapters·Updated Apr 19, 2026

Chapters

About this tutorial

A hands-on C++ tutorial designed to get you job-ready.

Ref: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines

Quick Start

# Compile and run your first program
cd examples
g++ -std=c++20 -Wall hello.cpp -o hello
./hello

# Or use the project template
cd projects
cmake -B build
cmake --build build
./build/myapp

Tutorial Contents

ChapterTopicDescription
00IntroductionWhy C++, market demand, tutorial overview
01Tooling SetupCompilers, IDEs, debuggers, build basics
02Basic SyntaxVariables, types, functions, control flow
03Memory ManagementPointers, references, RAII, smart pointers
04OOPClasses, inheritance, polymorphism
05Modern C++C++11 through C++23 features
06STLContainers, algorithms, iterators
07Build SystemsCMake, package managers, project structure
08Best PracticesIdioms, patterns, common pitfalls
09ProjectsHands-on coding exercises
10EcosystemTerminology, community, career paths

Prerequisites

  • Basic programming experience in any language
  • Command line familiarity
  • A C++ compiler (GCC, Clang, or MSVC)

Directory Structure

cpp/
├── README.md              # This file
├── 00-introduction.md     # Start here
├── 01-tooling-setup.md
├── ...
├── 09-projects.md
├── examples/              # Small code examples
│   └── hello.cpp
└── projects/              # Project templates
    ├── CMakeLists.txt
    └── main.cpp
  1. Week 1-2: Chapters 00-02 (Setup, Basics)
  2. Week 3-4: Chapters 03-04 (Memory, OOP)
  3. Week 5-6: Chapters 05-06 (Modern C++, STL)
  4. Week 7-8: Chapters 07-09 (Build Systems, Best Practices, Projects)

Compile Commands Reference

# Simple compilation
g++ -std=c++20 -Wall file.cpp -o program

# Debug build
g++ -std=c++20 -Wall -g -O0 file.cpp -o program_debug

# Release build
g++ -std=c++20 -Wall -O2 file.cpp -o program_release

# With sanitizers (debugging)
g++ -std=c++20 -Wall -g -fsanitize=address,undefined file.cpp -o program

# CMake build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Resources


Happy learning!