THE FIELD GUIDE / 163 LESSONS
One question, finished properly.
Read the claim, then the mechanism. Run the program. Answer the exercise yourself.
09Language fundamentals / C++11
In C++, both class and struct define class types, and both support constructors, destructors, inheritance, virtual functions, and templates. The language difference is mainly default member access and default inheritance access. Using struct for simple data and class to maintain invariants is a design convention, not a capability limit.
7 min↗
16Language fundamentals / C++11
static_cast, dynamic_cast, const_cast, and reinterpret_cast each express a different conversion intent, but the keywords themselves do not guarantee runtime safety. Before choosing one, first establish numeric range, dynamic type, actual mutability, and the object's lifetime, alignment, and type-access rules.
10 min↗
31Memory & ownership / C++20
Available storage at an address is not the same as an accessible object already existing there. To decide whether an access is valid, check size, alignment, object lifetime, access type, and bounds together. Construction and destruction determine the object's phase; allocation and deallocation determine the underlying storage's phase.
10 min↗
32Memory & ownership / C++11
A pointer is a typed value that may point to an object, a function, or a past-the-end position, or it may be null or invalid. Non-null is not proof that you may dereference. Correct use depends on the object still being alive, matching types, and access staying in bounds. A raw pointer itself also does not express deallocation responsibility.
8 min↗
34Memory & ownership / C++14
C++ specifies four storage durations—automatic, static, thread, and dynamic—and does not require a fixed stack, heap, or executable-file layout. The scope of a variable name, the linkage of a name, the lifetime of an object, and operating-system mappings answer different questions. They must not be mashed into a single address diagram.
9 min↗
36Memory & ownership / C++14
When choosing a parameter type, first decide whether the function only reads, needs to modify, or takes ownership, then compare copy cost. Pass small values by value, large read-only objects by const reference, nullable borrows by pointer, and exclusive ownership by passing unique_ptr by value. These types communicate different contracts.
9 min↗
45Memory & ownership / C++11
Split memory errors into spatial out-of-bounds, temporal invalidation, missing initialization, deallocation-protocol errors, and concurrency races, then choose matching evidence. The crash site is often only the consequence; trace the first illegal access and the allocation and free stacks, and fix the root cause with explicit bounds and owning interfaces.
11 min↗
67Containers & algorithms / C++20
Iterator categories describe which operations are available and at what complexity; they do not extend object lifetime. Separate single-pass input, multi-pass forward, bidirectional, random-access, and contiguous iterators, then check invalidation from container modifications on its own, before you combine algorithms.
10 min↗
104OSTEP / C11
Inspired by Feynman's lecture notes, the book is organized around virtualization, concurrency and persistence. It describes problem-first chapters, timelines, dialogues and other devices, plus free access, typical course pacing, and practical notes for both instructors and students.
8 min↗