C++: complete course
Move from C++ fundamentals into RAII, classes, templates, STL, modern memory management, algorithms and larger application design. Every chapter ends with practical projects so you build while you learn.
1C++ setup and compilation~10 min
What you are learning
1 C++ setup and compilation ~10 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
int main() { std::cout << "Orbit Code\n"; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
2Variables, types and operators~12 min
What you are learning
2 Variables, types and operators ~12 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
int main() { int score=82; std::cout << score << "\n"; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
3Input, output and formatting~14 min
What you are learning
3 Input, output and formatting ~14 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <iomanip>
int main() { double n=12.5; std::cout << std::fixed << std::setprecision(2) << n; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
4Control flow and functions~16 min
What you are learning
4 Control flow and functions ~16 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
int add(int a,int b){return a+b;}
int main(){ if(add(2,3)==5) std::cout<<"ok"; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
5References, pointers and memory~18 min
What you are learning
5 References, pointers and memory ~18 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
int main(){ int n=10; int &ref=n; int *ptr=&n; std::cout<<ref<<" "<<*ptr; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
6Strings, arrays and standard containers~20 min
What you are learning
6 Strings, arrays and standard containers ~20 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <vector>
#include <string>
int main(){ std::vector<std::string> c={"HTML","CSS"}; std::cout<<c[0]; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
7Classes and objects~22 min
What you are learning
7 Classes and objects ~22 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
class Course { public: std::string title; Course(std::string t):title(t){} };
int main(){ Course c("HTML"); std::cout<<c.title; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
8Inheritance and polymorphism~24 min
What you are learning
8 Inheritance and polymorphism ~24 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
struct Base{virtual void run(){std::cout<<"base";}}; struct Child:Base{void run() override{std::cout<<"child";}};
int main(){Child c; Base* b=&c; b->run();}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
9RAII and smart pointers~26 min
What you are learning
9 RAII and smart pointers ~26 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <memory>
struct Course{};
int main(){ auto c=std::make_unique<Course>(); std::cout<<"owned"; }Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
10Templates and generic programming~28 min
What you are learning
10 Templates and generic programming ~28 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
template<class T> T twice(T x){return x+x;}
int main(){std::cout<<twice(5);}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
11STL containers deeply~30 min
What you are learning
11 STL containers deeply ~30 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <unordered_map>
int main(){std::unordered_map<std::string,int> m{{"HTML",17}};std::cout<<m["HTML"];}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
12STL algorithms and iterators~32 min
What you are learning
12 STL algorithms and iterators ~32 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <vector>
#include <algorithm>
int main(){std::vector<int> v{3,1,2};std::sort(v.begin(),v.end());for(int x:v)std::cout<<x<<" ";}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
13Exceptions and error handling~34 min
What you are learning
13 Exceptions and error handling ~34 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
int main(){try{throw std::runtime_error("bad input");}catch(const std::exception& e){std::cout<<e.what();}}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
14Files, serialization and command-line programs~36 min
What you are learning
14 Files, serialization and command-line programs ~36 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <fstream>
#include <iostream>
int main(){std::ofstream f("notes.txt");f<<"Orbit Code";}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
15Modern C++ design~38 min
What you are learning
15 Modern C++ design ~38 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <string>
int main(){std::string name="Sam"; std::cout<<"Hello "<<name;}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
16Testing, performance and architecture~40 min
What you are learning
16 Testing, performance and architecture ~40 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <cassert>
int add(int a,int b){return a+b;}
int main(){assert(add(2,3)==5);}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
17Capstone: modern C++ application~42 min
What you are learning
17 Capstone: modern C++ application ~42 min is a core part of C++. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
#include <iostream>
#include <vector>
int main(){std::vector<std::string> courses={"HTML","CSS","JS"}; for(const auto& c:courses)std::cout<<c<<"\n";}Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused C++ mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example