We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

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 29,636 students in the Learn Memory Management in C course

Read reviews of their learning experiences

My brain definitely grew after I finished the course, I can feel my brain restarting the neurons that social media turned off

(5/5)
Francisco Agustín De La Colina Nieva profile image

Francisco Agustín De La Colina Nieva

Cordoba, Argentina

It was interesting to understand how memory is allocated, used, and freed. Python does all this for us automagically.

(4/5)
Silverberry Awtter profile image

Silverberry Awtter

Charlotte, United States

There are a variety of nice points and tips regarding memory management. There is also a great variety of structs and references to objects in this course. Helpful to gain a deeper understanding of how to navigate and reference through nested C structures.

(5/5)
Curtis Allen Jester profile image

Curtis Allen Jester

Athens, GA

This course is great for getting a deep understanding of how memory management works, and the basics of C. Since this isn't a C course, the nuances of how this language works, and how to use C in a real project aren't necessarily taught. It nonetheless does what it says on the tin, and does it very well.

(4/5)
OK-Kokei  profile image

OK-Kokei

Ireland

I had a little experience with C before this and this was still a difficult course, but well worth it.

(5/5)
Sannoso  profile image

Sannoso

United States

I never thought i'd ever implement a garbage collector. Fantastic course for exploring the internals of what goes on in garbage collected languages. Definitely a must.

(5/5)
Ziro  profile image

Ziro

Nairobi, Kenya

I took a C++ coursed many years ago so it was nice to come back to that style of language after learning some Python stuff. It provided a great comparison and deepened my overall understanding.

(5/5)
Tony Travis profile image

Tony Travis

Calgary, Alberta, Canada

amazing course i really enjoyed it. I didnt think C was this hard but I think I started getting it a lot more after this course.

(5/5)
Georgios Bakalski profile image

Georgios Bakalski

Athens, Greece

this is an awesome course, I had learned C and memory management before but this was a good refresher and went deeper.

(5/5)
Arun Paudel profile image

Arun Paudel

Canada

Showing 1-9 of 422

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.