Series 3: Pointers & Memory

This is the heart of C programming. Pointers and memory management are what separate C from Java — and what make C powerful. Every lesson includes stack/heap diagrams so you can see what's happening in memory.

Lessons

3.1: What Are Pointers and How Do I Use Them?

~22 min · Week 6 · Prereq: Lessons 2.5, 2.9

Address-of (&), dereference (*), pointer variables. Java references are invisible pointers — here, you control them explicitly.


3.2: How Do I Pass Variables by Pointer to Modify Them?

~20 min · Week 6 · Prereq: Lesson 3.1

Pass-by-value vs. pass-by-pointer. Why Java objects seem pass-by-reference but C makes you do it explicitly.


3.3: How Does Pointer Arithmetic Work and Connect to Arrays?

~22 min · Week 6 · Prereq: Lessons 3.1, 2.12

ptr + 1 moves by sizeof the type. Array indexing is just pointer arithmetic in disguise.


3.4: What Are Double Pointers and When Do I Use Them?

~20 min · Week 6 · Prereq: Lesson 3.2

Pointers to pointers, modifying a pointer from inside a function, 2D array access patterns.


3.5: How Do I Review Pointers and Prepare for Advanced Topics?

~18 min · Week 6 · Prereq: Lessons 3.1–3.4

Comprehensive pointer review and practice problems. Solidify before moving to dynamic memory.


3.6: How Is Memory Organized — Stack, Heap, and Beyond?

~22 min · Week 7 · Prereq: Lesson 3.5

Text, data, BSS, stack, heap segments. Where your variables actually live and why it matters.


3.7: How Do I Allocate and Free Memory Dynamically?

~22 min · Week 7 · Prereq: Lesson 3.6

calloc, malloc, free. Java’s garbage collector vs. manual memory management.


3.8: How Do I Resize Dynamic Arrays and Copy Memory?

~20 min · Week 7 · Prereq: Lesson 3.7

realloc, memcpy, memmove. Growing arrays at runtime — something Java’s ArrayList does behind the scenes.


3.9: How Do I Debug Memory Errors with Valgrind?

~20 min · Week 7 · Prereq: Lesson 3.7

Memory leaks, invalid reads/writes, use-after-free. Valgrind is your best friend for finding bugs Java would never let you create.


3.10: How Do I Write Programs with Dynamic Memory and Menus?

~18 min · Week 7 · Prereq: Lessons 3.7, 3.8, 3.9

Putting it all together: menu-driven programs with dynamically allocated data. A capstone for Series 3.


Related resources:

Previous series: ← Series 2: C Foundations

Next series: Series 4: Advanced C →