Learn Memory Management in C

Learn how to manually manage memory in C and build a garbage collector from scratch.

What will you learn?

Memory management is something that every programmer needs to deal with and understand at some point. If you're used to working with languages and tools that handle it for you, this course will teach you how all that works under the hood. You'll even build your own garbage collectors from scratch. This course will teach you the C basics you need for the course, but it's not a course about C, it's about memory.

Chapter List

1
C Basics
Introduction to the basics of the C programming language
2
Structs
Understand how C structs work and how they're laid out in memory
3
Pointers
You thought pointers were hard? Wrong. Let's figure them out together.
4
Enums
Learn how to use enums (enumerations) in C to create a set of named constants.
5
Unions
Unions in C are not the same as they are in TypeScript. Let's grok C unions.
6
Stack and Heap
Understand the difference between allocating memory on the stack and the heap
7
Advanced Pointers
Let's practice some more advanced pointer concepts - like pointers to pointers
8
Stack Data Structure
Build a stack in C using structs and pointers and understand where the memory is allocated
9
Objects
Implement your own object system for later use in your garbage collection algorithms
10
Refcounting GC
Implement a simple reference counting garbage collector from scratch in C
11
Mark and Sweep GC
Implement a basic mark and sweep garbage collector and understand its tradeoffs with refcounting

Join 21,204 students in the Learn Memory Management in C course

Read reviews of their learning experiences

I've always been a web dev, but was starving to peek at low level memory management. This course was...

(5/5)
Joaquin Paz profile image

Joaquin Paz

Buenos Aires, Argentina

Great intro into c, and good walk-through about the concept of garbage collection. What can get a li...

(4/5)
Jeremy Cribb profile image

Jeremy Cribb

United States

Nice course to learn or polish fundamentals! I had similar course "Intro to C" in Uni 15 years ago,...

(4/5)
Dmitrii Rogozin profile image

Dmitrii Rogozin

Luxembourg

Great course as a refresher for C. Wouldn't recommend it for beginners, but not every course needs t...

(5/5)
Viktor profile image

Viktor

Sweden

This course is fantastic! It covers everything from the simplest pointers to complex memory manageme...

(5/5)
Felipe D profile image

Felipe D

Argentina

Excellent course that covers pointers and an applied look at garbage collection. I really enjoyed t...

(5/5)
Nazwadi profile image

Nazwadi

United States

Found it easier than some of the earlier python lessons. Well explained and I felt like the assignme...

(5/5)
Crusader John profile image

Crusader John

Canada

Teej is the best programmer in the world

(5/5)
Arash Poorazam profile image

Arash Poorazam

Iran

w thankyou

(5/5)
sunny yadav profile image

sunny yadav

United States

Showing 1-9 of 247

or view more reviews

Mediocrity doesn't cut it anymore

The only way to become a great developer is to write a lot of code

Avoid tutorial hell

by writing a ton of code

Stay motivated with

a game-like curriculum

Build portfolio projects

to prove your skills

Delve deeper

into foundational concepts

Learn flexibly online

without interrupting your life

For 1% the price of college

to minimize your financial risk

Frequently asked Questions

Got questions? We've got answers

Yes! It's free to create an account and start learning. You'll get all the immersive and interactive features for free for a few chapters. After that, if you still haven't paid for a membership, you'll be in read-only (content only) mode.