Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
C for Game Dev - Part 1
·
Module 7
Dynamic Memory & Memory Safety
1
Stack vs. Heap: Memory Management
Explain the difference between stack and heap memory, and their respective use cases.
2
Dynamic Memory Allocation with malloc() and free()
Allocate and deallocate memory on the heap using malloc() and free().
Debugging Memory Leaks with Valgrind
Detect and fix memory leaks in a program using Valgrind.
4
Resizing Dynamic Memory with realloc()
Resize a dynamically allocated block of memory using realloc().
5
Dynamic Inventory with Dynamic Memory
Refactor the array-based inventory to use dynamic memory, allowing it to grow as needed.
Dynamic Inventory Expansion with `realloc()`
Implement a function to add items that uses realloc() to expand the inventory when it is full.
Previous module
Practical Application: Array-Based Inventory
Next module
Advanced Data Structures: Linked Lists