student@ubuntu:~$

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 different from every language you've used before. Every lesson includes stack/heap diagrams so you can see what's happening in memory.

Lessons

Week 6: Pointers & Memory

Pointer Basics

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

Pass-by-Pointer

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

Pointer Arithmetic & Arrays

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

Double Pointers

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


Week 7: Dynamic Memory

Stack, Heap & Memory Layout

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

calloc, realloc & free

calloc, realloc, free, memcpy, memmove. Java’s garbage collector vs. manual memory management.

Debugging Memory with Valgrind

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


Related resources:

Previous series: ← Series 2: C Foundations

Next series: Series 4: Advanced C →