cpp
C++
Memory and ownership, templates and modern C++
18 topics 6 sections C23 (GCC 13.3.0) beginner → intermediate
All beginner intermediate advanced
show All Unread Read
01 · Basics
12 topics C file I/O Open, read, write, and seek files reliably with C23 stdio streams while handling EOF, short counts, buffering, and close errors. intermediate 17 min C function pointers C23 function-pointer declarations, compatible types, callback context, and dispatch tables, including the casts and lifetime bugs to avoid. intermediate 16 min C fundamentals Start with translation units, types, and expressions, then learn C23 control flow, functions, error boundaries, conversions, and undefined behavior. beginner 16 min C preprocessor The C preprocessor expands macros, includes headers, and selects code before compilation; learn token replacement, configuration boundaries, and verifiable macros. intermediate 15 min C structs, unions and enums Model records with structs, reuse storage with unions, and tag states with enums while keeping layout, copying, and active-member rules explicit. intermediate 16 min C-style arrays Built-in C++23 arrays, including bounds, initialization, pointer conversion, multidimensional layout, lifetime, and safer standard-library alternatives. intermediate 19 min Classes C++ classes package state and behavior into user-defined types; learn access control, construction, invariants, and compiler-generated special members. beginner 13 min Exceptions C++ exceptions separate error detection from handling; learn type matching, stack unwinding, RAII, safety guarantees, and truthful noexcept boundaries. intermediate 15 min Inheritance C++ inheritance embeds a base subobject in a derived class and creates a substitutable type relationship; learn access, slicing, and virtual bases. intermediate 10 min Namespaces C++ namespaces organize names into scopes; understand qualified lookup, using declarations, ADL, and linkage boundaries to keep library APIs predictable. intermediate 16 min Operator overloading Operator overloading gives user-defined types natural C++ syntax; learn lookup, return types, and comparison contracts without semantic surprises. intermediate 16 min Virtual functions C++ virtual functions select an override from the dynamic type; learn pure virtual interfaces, safe destruction, and lifetime dispatch rules. intermediate 14 min
02 · Memory and ownership
5 topics C dynamic memory management Manage sizes, ownership, and lifetimes with C23 allocation functions, using verifiable cleanup paths to prevent leaks, overflows, and use-after-free. intermediate 16 min C pointers C pointers store object addresses; understand types, dereferencing, array bounds, lifetimes, and qualifiers to build contracts you can verify. intermediate 16 min RAII RAII binds resource ownership to C++ object lifetime; learn deterministic destruction, exception paths, move-only owners, and non-throwing cleanup. intermediate 15 min References Bind expressions to existing objects with C++ references; understand lvalue and rvalue references, lifetimes, and forwarding without dangling. intermediate 15 min Smart pointers Use unique_ptr for exclusive ownership and shared_ptr with weak_ptr for shared graphs, while avoiding control-block and lifetime bugs. intermediate 15 min