C / C++#

The foundational systems languages — C for operating systems, embedded, and kernels; C++ for performance-critical applications, game engines, and infrastructure. Understanding them gives you direct access to how computers actually work.

Overview#

C (1972) and C++ (1985) are distinct languages that share a common heritage. C is minimal by design — it maps closely to hardware and gives you manual control over every byte. C++ extends C with classes, templates, RAII, and a massive standard library while maintaining zero-cost abstraction as a core principle.

Together they power: the Linux kernel, Windows, macOS, PostgreSQL, SQLite, Redis, Nginx, Chrome (V8), Firefox, the JVM (HotSpot), CPython, LLVM/Clang, Unreal Engine, most game engines, and virtually every embedded system.

This path teaches both languages together because understanding C is essential for understanding C++, and many real-world codebases mix them. The early sections focus on C fundamentals; later sections introduce C++ features progressively.

Prerequisites#

  • Comfortable programming in any language
  • Basic understanding of how programs execute (stack, heap, function calls)
  • Command-line proficiency
  • Willingness to manage memory manually — the compiler will not save you

Sections#

#SectionTopics
1C FundamentalsCompilation, types, printf, control flow, functions
2Pointers & MemoryPointers, pointer arithmetic, arrays, stack vs heap, malloc/free
3Strings & ArraysC strings, string.h, multidimensional arrays, buffer overflows
4Structs & UnionsStruct layout, unions, bitfields, typedef, enums, memory alignment
5The Preprocessor & Compilation#include, #define, macros, header guards, compilation model, linking
6File I/O & System Callsstdio, file descriptors, POSIX I/O, errno, signals
7C++ CoreClasses, constructors/destructors, RAII, references, namespaces, const
8C++ Object-OrientedInheritance, virtual functions, polymorphism, abstract classes, operator overloading
9Templates & STLFunction/class templates, vector, map, algorithms, iterators
10Modern C++Smart pointers, move semantics, lambdas, auto, structured bindings, std::optional
11Concurrencypthreads, std::thread, mutex, atomics, condition variables, async
12Build Systems & ToolingMake, CMake, sanitizers, Valgrind, GDB, static analysis, packaging

C vs C++ at a Glance#

FeatureCC++
ParadigmProceduralMulti-paradigm (procedural, OOP, generic, functional)
Memory managementManual (malloc/free)Manual + RAII + smart pointers
Stringschar* + null terminatorstd::string
GenericsMacros or void*Templates
Error handlingReturn codes + errnoExceptions + std::optional + std::expected
Standard libraryMinimal (stdio, stdlib, string)Massive (containers, algorithms, I/O, threading)
ABI stabilityStable (de facto)Fragile (name mangling, vtable layout)
Use caseKernels, embedded, driversApplications, engines, infrastructure

Standard Versions#

LanguageStandardKey Additions
C89/C90Original ANSI CThe baseline
C99// comments, bool, variable-length arrays, stdint.h
C11_Atomic, _Thread_local, static_assert
C17Bug fixes only
C23#embed, typeof, nullptr, digit separators
C++11auto, lambdas, move semantics, smart pointers, threadsThe modern C++ revolution
C++14Generic lambdas, relaxed constexpr
C++17std::optional, structured bindings, if constexpr, std::filesystem
C++20Concepts, ranges, coroutines, modules, std::format
C++23std::expected, std::print, std::mdspan

This path targets C17 and C++17 as the baseline, with notes on C++20/23 features where relevant.