Welcome
A beginner-first course on C++ that teaches programming, computational thinking, and modern software design — assuming no prior experience.
Welcome to From Zero to C++ Programming. This course is written for people who have never written a line of code — or who have dabbled in a scripting language but never really learned what a program is, what memory actually looks like, or how a CPU ends up executing the text you typed into an editor.
You will not be asked to memorize syntax tables, race against a stopwatch, or solve cryptic interview puzzles. Instead, we will build two things together, slowly and on purpose:
- A mental model of the machine. What is memory? What is a stack? What is a heap? What happens between the moment you press Run and the moment "Hello, World!" appears on screen?
- A mental model of the software. How do humans tame complexity? What are variables, functions, types, objects, and modules really for? Why did programmers eventually invent classes, references, smart pointers, and RAII?
Once those two models click, the syntax becomes the easy part.
What is C++, and why learn it?
C++ is one of the most influential programming languages ever written. It powers operating systems, web browsers, video games, financial trading systems, machine-learning frameworks, databases, embedded controllers in cars and aircraft, and almost every other piece of software where speed, predictability, or direct hardware access matters.
C++ also has a reputation for being difficult. That reputation is half-earned: the language is large, and it gives you tools that other languages hide. But the core of C++ — the parts that beginners need — is small, precise, and rewarding. By the end of this course you will be writing programs that allocate memory, manage their own resources, define classes, and reason about performance with the confidence of someone who knows why their code works.
How this course is structured
The course is organized into ten short sections. Each builds on the previous one, but every page also stands on its own.
You will see three kinds of interactive widgets on most pages:
- Executable code blocks. Every C++ snippet compiles with
clang++in your browser and runs as a tiny WebAssembly binary under WASI. There is nothing to install. Edit any block and click Run. - Challenge cards. Hidden-test exercises that ask you to fill in a function, fix a bug, or build a small program. Some span multiple files so you can practice the header / implementation split used in real C++ projects.
- Multiple-choice questions. Quick comprehension checks at the end of most pages. Every option has its own explanation, so even a wrong answer teaches you something.
The browser is your toolchain
There is nothing to install. Every block below compiles and runs on
your own machine, in your browser, using clang++ built to
WebAssembly. Hit Run — the first time may take a moment while the
compiler loads.
What this course is not
This is not a competitive-programming bootcamp, an interview-prep course, or a framework tutorial. We will not cover advanced template metaprogramming, GUI toolkits, web frameworks, or DevOps. The goal is to make you a thoughtful programmer who happens to use C++. Everything else can be learned later, more easily, once that foundation is in place.
What you will be able to do at the end
By the time you finish the last page, you should be able to:
- Read a small C++ program and predict, step by step, what it does.
- Explain — to yourself or someone else — what the stack and the heap are, and which one your data lives on.
- Decide when to use a value, a reference, a pointer, or a smart pointer.
- Design a small class with constructors, a destructor, and a clean public interface.
- Use the standard library's containers (
std::vector,std::string,std::map) without fearing them. - Recognize and fix common beginner bugs: uninitialized variables, use-after-free, double-free, dangling references, infinite loops, off-by-one errors.
- Reason about whether one program will be faster than another, and why — without measuring.
That is more than enough to be a productive C++ programmer and a strong general software engineer. Let's begin.