home About Projects Culti7 Blog Courses Papers

Pointers: Thinking in Memory

3 of 11 chapters live · read in order

C's most feared feature is really one mental picture: memory as numbered boxes, and a pointer as a box that holds another box's number. Eleven chapters take you from why pointers exist at all, through the three classic bugs, const contracts, aliasing, and void*, up to smart pointers and a finale on undefined behaviour. Written for anyone who has compiled C before and still flinches at the asterisk.

01 Why Pointers?the reason they exist at all read 02 Addresses, & and *& asks where. * asks what's there. read 03 Arrays Are Not Pointersthe sizeof trap and the decay read
04 Stack, Heap, and Lifetimewhere memory actually lives coming
05 The Three Villainsnull, wild, and dangling coming
06 Pointers and Functionswhy C callbacks look like that coming
07 The const Puzzleone star, two positions, six characters coming
08 Aliasingtwo pointers, one very nervous compiler coming
09 The Typeless Pointerthe pointer that forgot its type coming
10 Ownership in the Type Systemunique, shared, weak coming
11 Where Seniors Earn Their Paywhy the compiler is allowed to do that coming