Master C++
Start from never having compiled anything and finish able to read, write and reason about C++: memory, lifetime, ownership, templates and the standard library.
Contents
C++ from the first compile to code you can ship. What a compiler does, the types you must name, memory, sequences, your own types, lifetime and RAII, owning things safely, building and testing a real project, templates, the standard library, errors, concurrency, measuring performance, and the habits that keep it readable.
Your first program
C++ is translated in full by a separate program, the compiler, before a single line of it runs. This section is about what that means in practice: the tools between your file and a running program, the five lines every program starts with, how to read the complaints the compiler makes, how to get something from the person at the keyboard into your program, and how a named block of instructions takes values in and hands an answer back.
- 6 min
What a compiler actually does
Your C++ is translated in full, once, before any of it runs. Almost everything else follows from that.
- 6 min
The tools between your file and a running program
Two tools, four stages, and the names for each of them, because those names are what the messages use.
- 11 min
Hello, and what every line of it means
The five lines every C++ program begins with, and what each one is actually for.
- 11 min
Errors the compiler gives you
How a compiler message is laid out, the four you will meet first, and why you fix only the top one.
- 10 min
Reading what somebody types
std::cin, somewhere to put what it reads, and the one thing about it that catches absolutely everybody.
- 7 min
Values in, an answer back
How a named block of instructions is handed values to work on, and how the answer gets out again.
- Easy
Conference badge
Coding problem · Strings, Functions
- Easy
Till receipt line
Coding problem · Strings, Numbers
- Easy
Weather widget
Coding problem · Numbers, Functions
- Medium
Box office summary
Coding problem · Strings, Numbers
Section quiz
Values and types
Opens once you finish Your first program, including its quiz.
Making decisions
Opens once you finish Values and types, including its quiz.
Repeating work
Opens once you finish Making decisions, including its quiz.
Functions
Opens once you finish Repeating work, including its quiz.
How C++ sees memory
Opens once you finish Functions, including its quiz.
Sequences
Opens once you finish How C++ sees memory, including its quiz.
Your own types
Opens once you finish Sequences, including its quiz.
Lifetime and RAII
Opens once you finish Your own types, including its quiz.
Owning things safely
Opens once you finish Lifetime and RAII, including its quiz.
Building, linking and the tools around the compiler
Opens once you finish Owning things safely, including its quiz.
Testing, and trusting your own code
Opens once you finish Building, linking and the tools around the compiler, including its quiz.
Writing code once for many types
Opens once you finish Testing, and trusting your own code, including its quiz.
The standard containers
Opens once you finish Writing code once for many types, including its quiz.
The standard algorithms
Opens once you finish The standard containers, including its quiz.
When things go wrong
Opens once you finish The standard algorithms, including its quiz.
More than one thing at a time
Opens once you finish When things go wrong, including its quiz.
Making it fast, and knowing that you did
Opens once you finish More than one thing at a time, including its quiz.
Writing C++ other people can read
Opens once you finish Making it fast, and knowing that you did, including its quiz.
Master C++ unit exam
Opens once every section is finished and every quiz is passed.