C++ Beginner Tutorial
New to programming? Start here. This tutorial walks you through C++ one small step at a time, with examples you can run right in your browser.
How this tutorial works
Each lesson explains one idea, shows a short C++ example with its expected output, lists common mistakes, and ends with a quick quiz and a practice exercise with hints. Lessons unlock in order, so you always have the basics you need before moving on.
You can run every example in the built-in C++ compiler — no installs needed. The first 10 stages are completely free.
Start lesson 1: Introduction to programming and C++Your beginner learning path
Absolute Beginner
Set up your tools, write programs, and learn variables, types and operators.
- Introduction to programming and C++
- How C++ compilation works
- Installing a compiler and setting up VS Code
- Writing and running your first program
- Understanding main(), headers, statements, and braces
- Comments and code formatting
- Output with cout
- Input with cin
- Variables and constants
- Fundamental data types
- Identifiers and naming rules
- Arithmetic operators
- Assignment and comparison operators
- Logical operators
- Increment and decrement
- Operator precedence
- Type conversion and casting
- Basic expressions and calculations
Conditions and Loops
Make decisions and repeat work.
Functions and Modular Programming
Split programs into reusable, testable pieces.
- Why functions matter
- Declaring and defining functions
- Function parameters
- Return values
- Void functions
- Pass by value
- Pass by reference
- Default arguments
- Function overloading
- Local and global scope
- Variable lifetime
- Recursion
- Base cases and recursive cases
- Header files and source files
- Basic program modularization
After the basics
Once you finish these stages, the full course roadmap continues through 30 stages: object-oriented programming, memory and pointers, the STL, data structures and algorithms, and real projects.