Back to Basics: Pointers and Memory
summary
Explains exact rules: arrays decay to pointers only in expressions and not on assignment, pointer arithmetic advances by sizeof(element) so p + k moves k elements, subtracting pointers yields a signed ptrdiff_t, and sizes use unsigned size_t (causing signed/unsigned pitfalls); prefers nullptr over NULL; array parameters are actually pointers; references are non-reseatable aliases with no null value; converting between unrelated pointer types requires casts and can produce undefined behavior; examples use sizeof, pointer increments, and pointer subtraction.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:15Raw pointers vs smart pointers
- 3:04When to use raw pointers
- 4:28Pointer basics
- 9:55Dangling pointers
- 12:06Arrays and pointer arithmetic
- 21:46Array vs pointer distinction
- 27:30Size_t and ptrdiff_t
- 38:07Pointer type conversions
- 44:14Other pointer conversions
- 51:03Pointer to void conversions
- 56:05References vs pointers
- 1:00:02Summary








