C++

C++

advanced

C, but with more ways to shoot yourself in the foot. And classes.

C++ is C with object-oriented programming, templates, and a standard library that actually does things. It's complex, but it's used for game engines, browsers, trading systems, and anything where performance is non-negotiable.

Game EnginesHigh-Frequency TradingBrowsersCompilersEmbedded Systems
0%
0/9 lessons

Setup

C++ uses the same compilers as C. GCC, Clang, and MSVC all support C++. Use the g++ or clang++ commands instead of gcc/cc.

Bash
# Same options as C — install GCC via MSYS2 or use Visual Studio
# With MSYS2:
pacman -S mingw-w64-ucrt-x86_64-gcc

# Use g++ to compile C++:
g++ hello.cpp -o hello -std=c++17

# Visual Studio (MSVC):
# cl /std:c++17 hello.cpp

Lessons

1
Hello, World!
C++ Hello World has a critical upgrade over C's version: it uses cout instead of
2
Variables & Types
C++ inherits all of C's types and adds a bunch of its own. The good news: you'll
3
Control Flow
Same as C, with a few quality-of-life improvements. The range-based for loop alo
4
Functions & References
C++ functions add default arguments, function overloading, and references — thin
5
Classes & OOP
Here's the part that justified calling C++ "C with classes." The original name,
6
STL Containers
The Standard Template Library is C++'s collection of containers and algorithms.
7
Error Handling & Exceptions
C++ uses exceptions for error handling. They're controversial in some circles —
8
Mini Project: Bank Account System
Let's put it all together: a small bank account system using classes, vectors, e
9
C++ Cheatsheet
Modern C++ (17/20) on one page — RAII, STL, smart pointers.